Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

DynaPDF Manual - Page 314

Previous Page 313   Index   Next Page 315

Function Reference
Page 314 of 770
FileAttachAnnot
Syntax:
SI32 pdfFileAttachAnnot(
const PPDF* IPDF,
// Instance pointer
double PosX,
// X-Coordinate for the annotation icon
double PosY,
// Y-Coordinate for the annotation icon
TFileAttachIcon Icon, // Annotation icon
const char* Author,
// Optional author
const char* Desc,
// Optional description
const char* AFile,
// File to be embedded (required)
LBOOL Compress)
// If true, the embedded file will be compressed
typedef enum
{
faiGraph,
faiPaperClip,
faiPushPin,
faiTag
}TFileAttachIcon;
The function inserts a file attachment annotation on the current open page. If the coordinate system
is bottom-up the point PosX, PosY defines the lower left point of the annotation icon. If the
coordinate system is top-down it defines the upper left point. The width and height of the icon is not
changeable.
The embedded file is compressed if the parameter Compress is set to true. Otherwise it is left
uncompressed. It is not always useful to compress embedded files especially if the file is already
compressed, e.g. Zip files or already compressed image formats require no further compression. In
the worst case the compressed files becomes larger. However, text files and most document formats
should be compressed to reduce the file size.
File attachment annotations are supported since PDF 1.3 (Acrobat 4). File attachments are supported
since PDF 1.4 (Acrobat 5). The difference between both attachment types is that a file attachment
annotation is used as a comment that has usually a visible icon on a page, e.g. to provide additional
information about a specific object.
File attachments are used to add arbitrary files to the PDF file, e.g. job options, the original document
from which the file was created, or any other file (see also AttachFile()).
Note that Acrobat 7 or higher restricts access to executable files and compressed file formats such as
zip, or rar. If such files must be embedded then change the file extension, e.g. to .dat or .bin. The user
must then change the extension again when extracting the file.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. Note that Unicode file
paths are not supported under Linux and UNIX. The file path is converted back to Ansi on these
 

Previous topic: ExchangePages, ExtractText

Next topic: FileAttachAnnotEx, FileLink