DynaPDF Manual - Page 811

Previous Page 810   Index   Next Page 812

Function Reference
Page 811 of 818
This tag adds a link to a page. The parameters are as follows:
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 CreateNamedDest())
PDF file in which the named destination is located
Link annotations support more properties which must be set before calling WriteFText():
Border width
-> SetLineWidth()
Border dash pattern
-> SetLineDashPattern()
Border color
-> SetStrokeColor()
Border color space
-> SetStrokeColorSpace()
Highlight mode
-> SetLinkHighlightMode()
The first four parameters are required. The last parameter is required only if IsNamedDest
and IsExternalLink are both true.
The path to an external PDF file should be a relative path. Although Unicode paths are
supported since Acrobat 8, it is usually best to restrict the character set to plain english.
This tag must be terminated with a \EK# tag. At least one character must occur between
\LK[...] and the corresponding \EK# tag. The link is created over these characters. If a line
or page break occurs before the terminating \EK# tag, the link annotation is created over
multiple text lines. This results maybe also in multiple link annotations if a page break
Parameters of type bool can be defined as integer value 0 = false, 1 = true, or as string (non-
case-sensitive). Unlike other command tags, whitespace between values are ignored and
does not result in an error. All character codes below 33 are considered as whitespace.
The parameter URL is passed to WebLink() if IsNamedDest is false. If IsNamedDest is true,
URL must be the name of a named destination. If IsExternalLink is false, URL is passed to
PageLink3(). If true, the function creates a link annotation and a Go To Remote Action with
CreateGoToRActionEx(). The Unicode version of WriteFText() calls
CreateGoToRActionExU() to preserve the Unicode file name.
\LK[false, TRUE, false, https://www.dynaforms.com]Test\EK# // Ok
\LK[0,1,0,https://www.dynaforms.com]Test\EK# // Same as above
\LK[true, true, true, NameOfADestination, test.pdf]Test\EK# // Ok
\LK[false, true, false, www.dyna forms.com
]Test\EK# // Invalid URL!
\LK[true, true, true, DestName, file name with spaces.pdf ]Test\EK# // Ok
The file name in the last example is treated as "file name with spaces.pdf". Leading and
trailing spaces are ignored.

Previous topic: Command tags

Next topic: Special characters

Start Chat