Jump to content
Server Maintenance This Week. ×

DynaPDF WriteFText with links inside


This topic is 1295 days old. Please don't post here. Open a new topic instead.

Recommended Posts

WriteFText.jpgFor the MBS FileMaker Plugin in version 10.5pr3 we include the new DynaPDF library in version 4.0.43.121. The WriteFText function can now create links within the text:

  • to a web site
  • to a named destination within the same PDF.
  • to a named destination within another PDF document

You include \LK[] command in the text as command in your text and then specify the website. Within the brackets you specify 4 to 5 parameters:

  • IsNamedDest (false or 0, true or 1)
  • IsExternalLink (false or 0, true or 1)
  • OpenInNewWindow (false or 0, true or 1)
  • URL or name of a named destination (see DynaPDF.CreateNamedDest()) 
  • PDF file in which the named destination is located

As you see you can specify booleans either as true/false or 1/0. Whitespace before/after is ignored. To give a few examples:

  • \LK[false, TRUE, false, https://www.dynaforms.com]Test\EK# 
  • \LK[0,1,0,https://www.dynaforms.com]Test\EK#
  • \LK[true, true, true, NameOfADestination, test.pdf]Test\EK#
  • \LK[true, true, true, DestName, file name with spaces.pdf ]Test\EK#

You may want to use DynaPDF.SetLinkHighlightMode function before calling DynaPDF.WriteFText to set the highlight mode for clicking the link. You can have a border around the link defined with DynaPDF.SetLineWidth or DynaPDF.SetStrokeColor functions. 

It may be good to combine this link feature with underline \ul# and then switch color with \FC[] and the right color. For blue, we use 16711680, which is 255 * 256 * 256 as returned by DynaPDF.RGB funtion:

\FC[16711680]\ul#\LK[false, TRUE, false, https://www.dynaforms.com]Test\EK#\ul#\FC[0]

Looks like this: Test. As you see we pick blue color, underline and the text with link inside. But on the end we turn underline off and set text color to black (0).

 

In FileMaker use this with DynaPDF.WriteFText or DynaPDF.WriteFTextEx functions. For DynaPDF.WriteStyledText, this won't work as we escape the backslash. So use a placeholder like "$link$", call DynaPDF.ConvertStyledText to convert text and then replace the placeholder with the command above.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.