DynaPDF Manual - Page 350
Previous Page 349 Index Next Page 351
Function Reference
Page 350 of 839
FileLink
Syntax:
SI32 pdfFileLink(
const PPDF* IPDF,
// Instance pointer
double PosX,
// X-Coordinate of bounding rectangle
double PosY,
// Y-Coordinate of bounding rectangle
double Width,
// Width of bounding rectangle
double Height,
// Height of bounding rectangle
const char* AFilePath) // File path
The function creates a file link annotation. A file link annotation opens a file by using the application
that is connected with the file extension (MIME type). Viewer applications maybe display a warning
before the file is opened.
The file path can be defined as relative or absolute path. However, the usage of an absolute makes
only sense if it can be guaranteed that the path exist on an arbitrary system.
If the coordinate system is bottom-up the point PosX, PosY defines the lower left corner of the
bounding rectangle. If the coordinate system is top-down it defines the upper left corner.
The border of the link annotation is drawn by using the current line width, stroke color and line
dash pattern. If the link should appear without a border set the line width to zero beforehand.
When clicking on a link annotation the rectangle is highlighted, that is a simple visual effect. Several
highlight modes are supported, see SetLinkHighlightMode() for further information.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. On Windows operating
systems the path can be defined as Ansi or Unicode string depending on whether the Ansi or
Unicode version of the function was called.
Like all file paths, the path of the Ansi version must be an UTF-8 encoded Unicode string on non-
Windows operating systems.
The function does not check whether the path is valid.
Return values:
If the function succeeds the return value is a annotation handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
Previous topic: FileAttachAnnotEx
Next topic: FindBookmark, FindEmbeddedFile