DynaPDF Manual - Page 362
Previous Page 361 Index Next Page 363

Function Reference
Page 362 of 860
The optional parameter Area can be set to restrict the text extraction to that rectangle. The rectangle
must be defined according to the current coordinate system. That means either in bottom up or top
down coordinates, see SetPageCoords() for further information. Note also that the function
considers the orientation of the page. The width and height of the rectangle must be exchanged if
the orientation is 90, -90, 270, or -270 degrees.
The function SetSpaceWidthFactor() can be used to adjust the space width factor that is used to
identify emulated space characters. This can be useful if too many or too few spaces occur in
extracted text.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
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.
Previous topic: ExchangePages, ExtractText
Next topic: FileAttachAnnotEx