Created by pdf2html convertor (https://loslab.com)
Delphi Edition
ActiveX Edition
DLL Edition
Version 3.x
Copyright© 2007-2024 https://loslab.com
Reference Guide
losLab PDF Library
AddArcToPath
Vector graphics, Path definition and drawing, Form fields, Annotations and hotspot
links
Description
Adds an arc to the current path.
The arc is drawn around a center point for a specified number of degrees either clockwise or
anti-clockwise.
Syntax
Delphi
function TPDFlib.AddArcToPath(CenterX, CenterY,
TotalAngle: Double): Integer;
ActiveX
Function PDFlib::AddArcToPath(CenterX As Double,
CenterY As Double, TotalAngle As Double) As Long
DLL
int DLAddArcToPath(int InstanceID, double CenterX, double CenterY,
double TotalAngle);
Parameters
CenterX
The horizontal co-ordinate of the center of the arc
CenterY
The vertical co-ordinate of the center of the arc
TotalAngle
The angular length of the arc. If this value is positive the arc will be drawn in a
clockwise direction. A negative value will result in an arc drawn in an
anti-clockwise direction. This value must be greater or less than 0. A value of 360
will result in a full circle being drawn.
Copyright© 2007-2024 https://loslab.com
AddBoxToPath
Vector graphics, Path definition and drawing
Description
Adds a rectangle to the current path.
Syntax
Delphi
function TPDFlib.AddBoxToPath(Left, Top, Width, Height: Double): Integer;
ActiveX
Function PDFlib::AddBoxToPath(Left As Double,
Top As Double, Width As Double, Height As Double) As Long
DLL
int DLAddBoxToPath(int InstanceID, double Left, double Top, double Width, double Height);
Parameters
Left
The horizontal co-ordinate of the left edge of the box
Top
The vertical co-ordinate of the top edge of the box
Width
The width of the box
Height
The height of the box
Copyright© 2007-2024 https://loslab.com
AddCJKFont
Text, Fonts
Description
Adds a CJK (Chinese Japanese Korean) font to the PDF document.
At present, the only supported CJK fonts are the Japanese "HeiseiKakuGo-W5" font and the Korean
"HYGoThic-Medium" font.
Syntax
Delphi
function TPDFlib.AddCJKFont(CJKFontID: Integer): Integer;
ActiveX
Function PDFlib::AddCJKFont( CJKFontID As Long) As Long
DLL
int DLAddCJKFont(int InstanceID, int CJKFontID);
Parameters
CJKFontID
1 = HeiseiKakuGo-W5
2 = HeiseiKakuGo-W5 (Bold)
3 = HeiseiKakuGo-W5 (Bold Italic)
4 = HeiseiKakuGo-W5 (Italic)
5 = HYGoThic-Medium
6 = HYGoThic-Medium (Bold)
7 = HYGoThic-Medium (Bold Italic)
8 = HYGoThic-Medium (Italic)
Copyright© 2007-2024 https://loslab.com
AddCurveToPath
Vector graphics, Path definition and drawing
Description
Adds a bezier curve to the current path.
The curve is drawn from the last point to the point defined by (EndX, EndY).
(CtAX, CtAY) and (CtBX, CtBY) define the two bezier control points.
Syntax
Delphi
function TPDFlib.AddCurveToPath(CtAX, CtAY, CtBX, CtBY,
EndX, EndY: Double): Integer;
ActiveX
Function PDFlib::AddCurveToPath(CtAX As Double,
CtAY As Double, CtBX As Double, CtBY As Double,
EndX As Double, EndY As Double) As Long
DLL
int DLAddCurveToPath(int InstanceID, double CtAX, double CtAY,
double CtBX, double CtBY, double EndX, double EndY);
Parameters
CtAX
The horizontal co-ordinate of the first control point
CtAY
The vertical co-ordinate of the first control point
CtBX
The horizontal co-ordinate of the second control point
CtBY
The vertical co-ordinate of the second control point
EndX
The horizontal co-ordinate of the end point of the bezier curve
EndY
The vertical co-ordinate of the end point of the bezier curve
Copyright© 2007-2024 https://loslab.com
AddEmbeddedFile
Document properties
Description
Embeds a file into the PDF but does not link it to any part of the document.
The AddFileAttachment function can be used to make the embedded file available as an
attachment in the PDF viewer. The PDF viewer must support this functionality (Adobe Reader 7 and
later). This process can be done in one step using the EmbedFile function.
The AddLinkToEmbeddedFile function can be used to create a hotspot on a page that links to the
embedded file.
Syntax
Delphi
function TPDFlib.AddEmbeddedFile(FileName,
MIMEType: WideString): Integer;
ActiveX
Function PDFlib::AddEmbeddedFile(
FileName As String, MIMEType As String) As Long
DLL
int DLAddEmbeddedFile(int InstanceID, wchar_t * FileName,
wchar_t * MIMEType);
Parameters
FileName
The path and filename of the file to embed into the PDF.
MIMEType
The MIME type of the embedded file. For example "image/jpeg" for a JPEG image.
Return values
0
The file could not be found or there was an error embedding the file into the PDF
Non-zero An EmbeddedFileID that can be used with the AddFileAttachment function
Copyright© 2007-2024 https://loslab.com
AddFileAttachment
Document properties
Description
Makes an embedded file available as an attachment in the PDF viewer, if it supports this
functionality. Adobe Reader 7 and later allow the user to work with file attachments.
First use the AddEmbeddedFile function to embed the file into the PDF.
Syntax
Delphi
function TPDFlib.AddFileAttachment(Title: WideString;
EmbeddedFileID: Integer): Integer;
ActiveX
Function PDFlib::AddFileAttachment(
Title As String, EmbeddedFileID As Long) As Long
DLL
int DLAddFileAttachment(int InstanceID, wchar_t * Title,
int EmbeddedFileID);
Parameters
Title
The title of the attachment that should appear in the PDF viewer
EmbeddedFileID The value returned from the AddEmbeddedFile function
Return values
0
The EmbeddedFileID parameter was invalid, or the Title was blank
1
The embedded file was made available as an attachment successfully
Copyright© 2007-2024 https://loslab.com
AddFormFieldChoiceSub
Form fields
Description
Similar to the AddFormFieldSub function but allows a choice field item's export value and display
value to be set.
The function returns a temporary form field Index which can be used with the
SetFormFieldBounds, SetFormFieldCheckStyle and other functions.
Syntax
Delphi
function TPDFlib.AddFormFieldChoiceSub(Index: Integer;
SubName, DisplayName: WideString): Integer;
ActiveX
Function PDFlib::AddFormFieldChoiceSub(
Index As Long, SubName As String,
DisplayName As String) As Long
DLL
int DLAddFormFieldChoiceSub(int InstanceID, int Index, wchar_t * SubName,
wchar_t * DisplayName);
Parameters
Index
The index of the form field to work with. The first form field has an index of 1.
The form field must be a choice field.
SubName
The export value of the new sub-field. The value of the form field could be set
to this name using the SetFormFieldValue function.
DisplayName
The display name of the new sub-field.
Return values
0
The sub-field was not added. The specified form field may not have been a
choice form field.
Non-zero
A temporary field Index
Copyright© 2007-2024 https://loslab.com
AddFormFieldSub
Form fields
Description
Adds a sub-field to the specified radio-button or choice form field.
The function returns a temporary form field Index which can be used with the
SetFormFieldBounds, SetFormFieldCheckStyle and other functions.
To set a choice item's export value and display value use the AddFormFieldChoiceSub function.
Syntax
Delphi
function TPDFlib.AddFormFieldSub(Index: Integer;
SubName: WideString): Integer;
ActiveX
Function PDFlib::AddFormFieldSub(Index As Long,
SubName As String) As Long
DLL
int DLAddFormFieldSub(int InstanceID, int Index, wchar_t * SubName);
Parameters
Index
The index of the form field to work with. The first form field has an index of 1.
SubName
The name of the new sub-field. The value of the form field could be set to this
name using the SetFormFieldValue function.
Return values
0
The sub-field was not added. The specified form field may not have been a
radio-button or choice form field.
Non-zero
A temporary field Index
Copyright© 2007-2024 https://loslab.com
AddFormFont
Fonts, Form fields
Description
Adds a font to the form.
The font must have been added using one of the Add*Font functions.
Syntax
Delphi
function TPDFlib.AddFormFont(FontID: Integer): Integer;
ActiveX
Function PDFlib::AddFormFont(FontID As Long) As Long
DLL
int DLAddFormFont(int InstanceID, int FontID);
Parameters
FontID
The FontID returned by one of the Add*Font functions
Return values
0
Invalid FontID
Non-zero
The font was added successfully, the value returned is the number of fonts
available for use by form fields
Copyright© 2007-2024 https://loslab.com
AddFreeTextAnnotation
Text, Annotations and hotspot links
Description
Adds a free text annotation to the selected page. If a border and/or fill is specified using the
Options parameter then the settings are retrieved from the current line color, fill color, line width,
pen dash settings.
SetLineColor does not affect border color. Border color is currently set to the same color as the text
color due to the way Acrobat works. SelectFont does not affect font style. Currently the font is
hardcoded to the standard Helvetica font due to the way Acrobat works.
SetTextSize will affect text size correctly
SetTextColor will affect text color correctly
SetLineWidth will adjust border width correctly
SetTextAlign will adjust text alignment correctly
The SetTransparency function will *not* change the transparency of annotations. Use the new
AddFreeTextAnnotationEx function if you want to adjust transparency settings.
Syntax
Delphi
function TPDFlib.AddFreeTextAnnotation(Left, Top, Width,
Height: Double; Text: WideString; Angle, Options: Integer): Integer;
ActiveX
Function PDFlib::AddFreeTextAnnotation(
Left As Double, Top As Double, Width As Double,
Height As Double, Text As String, Angle As Long, Options As
Long) As Long
DLL
int DLAddFreeTextAnnotation(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * Text, int Angle,
int Options);
Parameters
Left
The horizontal coordinate of the left edge of the annotation rectangle
Top
The vertical coordinate of the left edge of the annotation rectangle
Width
The width of the annotation rectangle
Height
The height of the annotation rectangle
Text
The text content of the annotation
Angle
The angle of the drawn text. Can be 0, 90, 180 or 270.
Options
0 = Outline
1 = Fill
2 = Fill and Outline
Copyright© 2007-2024 https://loslab.com
AddFreeTextAnnotationEx
Text, Annotations and hotspot links
Description
Adds a free text annotation to the selected page. If a border and/or fill is specified using the
Options parameter then the settings are retrieved from the current line color, fill color, line width,
pen dash settings. Use the Transparency parameter to adjust the transparency settings for free
text annotations. The SetTransparency function does not work with annotations.
SetLineColor does not affect border color. Border color is currently set to the same color as the text
color due to the way Acrobat works. SelectFont does not affect font style. Currently the font is
hardcoded to standard Helvetica font due to the way Acrobat works.
SetTextSize will affect text size correctly
SetTextColor will affect text color correctly
SetLineWidth will adjust border width correctly
SetTextAlign will adjust text alignment correctly
Syntax
Delphi
function TPDFlib.AddFreeTextAnnotationEx(Left, Top, Width,
Height: Double; Text: WideString; Angle, Options,
Transparency: Integer): Integer;
ActiveX
Function PDFlib::AddFreeTextAnnotationEx(
Left As Double, Top As Double, Width As Double, Height As
Double, Text As String, Angle As Long, Options As Long,
Transparency As Long) As Long
DLL
int DLAddFreeTextAnnotationEx(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * Text, int Angle,
int Options, int Transparency);
Parameters
Left
The horizontal coordinate of the left edge of the annotation rectangle
Top
The vertical coordinate of the left edge of the annotation rectangle
Width
The width of the annotation rectangle
Height
The height of the annotation rectangle
Text
The text content of the annotation
Angle
The angle of the drawn text. Can be 0, 90, 180 or 270.
Options
0 = Outline
1 = Fill
2 = Fill and Outline
Transparency
The amount of transparency to apply
0 = No transparency
50 = 50% transparency
100 = Invisible
Copyright© 2007-2024 https://loslab.com
AddGlobalJavaScript
Document properties, JavaScript
Description
Adds JavaScript to a global location in the document.
For example, this allows functions to be defined which can then be called from JavaScript attached
to events.
Syntax
Delphi
function TPDFlib.AddGlobalJavaScript(PackageName,
JavaScript: WideString): Integer;
ActiveX
Function PDFlib::AddGlobalJavaScript(
PackageName As String, JavaScript As String) As Long
DLL
int DLAddGlobalJavaScript(int InstanceID, wchar_t * PackageName,
wchar_t * JavaScript);
Parameters
PackageName
The name to store the JavaScript under. If any JavaScript is already stored
under this name it will be removed and the new JavaScript will be stored in its
place.
JavaScript
The JavaScript to store globally under the specified package name.
Return values
0
The PackageName was empty
1
The JavaScript was stored successfully
Copyright© 2007-2024 https://loslab.com
AddImageFromFile
Image handling
Description
Adds an image from a file to the selected document.
Once an image has been added to the document it can be drawn on any page multiple times
without further increasing the size of the PDF file.
Supported image file types are: BMP, TIFF, JPEG, PNG, GIF, WMF and EMF.
For BMP and TIFF images, the CompressImages function can called before calling this function to
compress the image data. Other image types are automatically compressed.
Syntax
Delphi
function TPDFlib.AddImageFromFile(FileName: WideString;
Options: Integer): Integer;
ActiveX
Function PDFlib::AddImageFromFile(
FileName As String, Options As Long) As Long
DLL
int DLAddImageFromFile(int InstanceID, wchar_t * FileName, int Options);
Parameters
FileName
The file name of the image to add.
Options
For multi-page TIFF images this parameter specifies the page number to load.
For PNG images:
0 = Load the image as usual
1 = Load the alpha channel as a greyscale image
2 = Load the image and alpha channel (limit alpha to 8-bit)
3 = Load the image (limit image 8-bit/channel)
4 = Load the alpha channel (limit to 8-bit/channel)
5 = Load the image with alpha channel (limit both to 8-bit/channel)
6 = Load the image and alpha channel
7 = Load the image and ICC color profile
For other image types this parameter should be set to 0.
Setting Options to -1 forces TIFF, EMF and WMF images to be loaded using the
GDI+ graphics library. Multipage TIFF images can also be loaded using GDI+ by
setting the Options parameter to -PageNumber (for example -3 for page 3).
Return values
0
The image could not be added. Either it could not be found or it is in an
unsupported format.
Non-zero
The image was added successfully. The ImageID is returned which can be passed
to functions like SelectImage and DrawImage.
Copyright© 2007-2024 https://loslab.com
AddImageFromFileOffset
Image handling
Description
Adds an image from a part of a file to the selected document.
For example, if many images have been concatenated into one file this function will allow the
individual images to be extracted and added to the document.
Once an image has been added to the document it can be drawn on any page multiple times without
further increasing the size of the PDF file.
Supported image file types are: BMP, TIFF, JPEG, PNG, GIF, WMF and EMF.
For BMP and TIFF images, the CompressImages function can called before calling this function to
compress the image data. Other image types are automatically compressed.
Syntax
Delphi
function TPDFlib.AddImageFromFileOffset(
FileName: WideString; Offset, DataLength, Options: Integer): Integer;
ActiveX
Function PDFlib::AddImageFromFileOffset(
FileName As String, Offset As Long, DataLength As Long,
Options As Long) As Long
DLL
int DLAddImageFromFileOffset(int InstanceID, wchar_t * FileName,
int Offset, int DataLength, int Options);
Parameters
FileName
The name of the file containing the images.
Offset
The offset into the file where the required image starts. The first byte in the file
has an offset of 0.
DataLength
The length of the image data in bytes
Options
For multi-page TIFF images this parameter specifies the page number to load.
For PNG images:
0 = Load the image as usual
1 = Load the alpha channel as a greyscale image
2 = Load the image and alpha channel (limit alpha to 8-bit)
3 = Load the image (limit image 8-bit/channel)
4 = Load the alpha channel (limit to 8-bit/channel)
5 = Load the image with alpha channel (limit both to 8-bit/channel)
6 = Load the image and alpha channel
7 = Load the image and ICC color profile
For other image types this parameter should be set to 0.
Setting Options to -1 forces TIFF, EMF and WMF images to be loaded using the
GDI+ graphics library. Multipage TIFF images can also be loaded using GDI+ by
setting the Options parameter to -PageNumber (for example -3 for page 3).
Return values
0
The image could not be read from the file. This could indicate invalid image data or
the file could not be found.
Non-zero
The image was read from the file and successfully added to the document. The
value returned is the ID of the image which can be used with the image drawing
functions such as DrawImage.
Copyright© 2007-2024 https://loslab.com
AddImageFromStream
Image handling
Description
Adds an image from a TStream to the selected document.
Once an image has been added to the document it can be drawn on any page multiple times
without further increasing the size of the PDF file.
Supported image file types are: BMP, TIFF, JPEG, PNG, GIF, WMF and EMF.
For BMP and TIFF images, the CompressImages function can called before calling this function to
compress the image data. Other image types are automatically compressed.
Syntax
Delphi
function TPDFlib.AddImageFromStream(InStream: TStream;
Options: Integer): Integer;
Parameters
InStream
The TStream object containing the image data. The current position in the stream
will be ignored, image data will be read from position 0 in the stream.
Options
For multi-page TIFF images this parameter specifies the page number to load.
For PNG images:
0 = Load the image as usual
1 = Load the alpha channel as a greyscale image
2 = Load the image and alpha channel (limit alpha to 8-bit)
3 = Load the image (limit image 8-bit/channel)
4 = Load the alpha channel (limit to 8-bit/channel)
5 = Load the image with alpha channel (limit both to 8-bit/channel)
6 = Load the image and alpha channel
7 = Load the image and ICC color profile
For other image types this parameter should be set to 0.
Setting Options to -1 forces TIFF, EMF and WMF images to be loaded using the
GDI+ graphics library. Multipage TIFF images can also be loaded using GDI+ by
setting the Options parameter to -PageNumber (for example -3 for page 3).
Return values
0
There was an error reading valid image data from the stream
Non-zero
The image was successfully added to the document. The value returned is the ID of
the image which can be used with the image drawing functions such as
DrawImage.
Copyright© 2007-2024 https://loslab.com
AddImageFromString
Image handling
Description
Adds an image from memory to the selected document.
Once an image has been added to the document it can be drawn on any page multiple times
without further increasing the size of the PDF file.
Supported image file types are: BMP, TIFF, JPEG, PNG, GIF, WMF and EMF.
For BMP and TIFF images, the CompressImages function can called before calling this function to
compress the image data. Other image types are automatically compressed.
Syntax
Delphi
function TPDFlib.AddImageFromString(
const Source: AnsiString; Options: Integer): Integer;
DLL
int DLAddImageFromString(int InstanceID, char * Source, int Options);
Parameters
Source
A string containing the image data. In the ActiveX version of the library this string
must contain 16-bit characters, only the lower 8-bits of each character will be used.
Options
For multi-page TIFF images this parameter specifies the page number to load.
For PNG images:
0 = Load the image as usual
1 = Load the alpha channel as a greyscale image
2 = Load the image and alpha channel (limit alpha to 8-bit)
3 = Load the image (limit image 8-bit/channel)
4 = Load the alpha channel (limit to 8-bit/channel)
5 = Load the image with alpha channel (limit both to 8-bit/channel)
6 = Load the image and alpha channel
7 = Load the image and ICC color profile
For other image types this parameter should be set to 0.
Setting Options to -1 forces TIFF, EMF and WMF images to be loaded using the GDI+
graphics library. Multipage TIFF images can also be loaded using GDI+ by setting the
Options parameter to -PageNumber (for example -3 for page 3).
Return values
0
The image data was invalid or the image was in an unsupported format
1
The image was added successfully. The value returned is the ImageID which can be
used with functions like SelectImage and DrawImage.
Copyright© 2007-2024 https://loslab.com
AddImageFromVariant
Image handling
Description
Adds an image from a variant byte array to the selected document.
Once an image has been added to the document it can be drawn on any page multiple times
without further increasing the size of the PDF file.
Supported image file types are: BMP, TIFF, JPEG, PNG, GIF, WMF and EMF.
For BMP and TIFF images, the CompressImages function can called before calling this function to
compress the image data. Other image types are automatically compressed.
Syntax
ActiveX
Function PDFlib::AddImageFromVariant(
SourceData As Variant, Options As Long) As Long
Parameters
SourceData
A variant containing the image data
Options
For multi-page TIFF images this parameter specifies the page number to load.
For PNG images:
0 = Load the image as usual
1 = Load the alpha channel as a greyscale image
2 = Load the image and alpha channel (limit alpha to 8-bit)
3 = Load the image (limit image 8-bit/channel)
4 = Load the alpha channel (limit to 8-bit/channel)
5 = Load the image with alpha channel (limit both to 8-bit/channel)
6 = Load the image and alpha channel
7 = Load the image and ICC color profile
For other image types this parameter should be set to 0.
Setting Options to -1 forces TIFF, EMF and WMF images to be loaded using the
GDI+ graphics library. Multipage TIFF images can also be loaded using GDI+ by
setting the Options parameter to -PageNumber (for example -3 for page 3).
Return values
0
The image could not be added
Non-zero
The image was added successfully. This is the ID of the new image.
Copyright© 2007-2024 https://loslab.com
AddLGIDictToPage
Page properties, Measurement and coordinate units
Description
Adds a new LGIDict object to the selected page.
This is used with the GeoPDF system as defined in Open Geospatial Consortium Inc.'s OGC
08-139r2 specification.
More than one dictionary can be added to the page.
Syntax
Delphi
function TPDFlib.AddLGIDictToPage(
DictContent: WideString): Integer;
ActiveX
Function PDFlib::AddLGIDictToPage(
DictContent As String) As Long
DLL
int DLAddLGIDictToPage(int InstanceID, wchar_t * DictContent);
Parameters
DictContent
The LGIDict dictionary content to add to the page.
Return values
0
The LGI dictionary could not be added to the page. Check that the dictionary
content string is a valid PDF dictionary.
1
The LGI dictionary was added successfully.
Copyright© 2007-2024 https://loslab.com
AddLineToPath
Vector graphics, Path definition and drawing
Description
Adds a line to the current path.
The line is drawn from the last point to the point defined by (EndX, EndY).
Syntax
Delphi
function TPDFlib.AddLineToPath(EndX, EndY: Double): Integer;
ActiveX
Function PDFlib::AddLineToPath(EndX As Double,
EndY As Double) As Long
DLL
int DLAddLineToPath(int InstanceID, double EndX, double EndY);
Parameters
EndX
The horizontal co-ordinate of the end point of the line to add to the path
EndY
The vertical co-ordinate of the end point of the line to add to the path
Copyright© 2007-2024 https://loslab.com
AddLinkToDestination
Annotations and hotspot links, Page properties
Description
Adds a clickable hotspot rectangle to the selected page which links to another page in the same
document. The target page, position and zoom level are specified by a destination object which can
be created with the NewDestination function.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToDestination(Left, Top, Width,
Height: Double; DestID, Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToDestination(
Left As Double, Top As Double, Width As Double,
Height As Double, DestID As Long, Options As Long) As Long
DLL
int DLAddLinkToDestination(int InstanceID, double Left, double Top,
double Width, double Height, int DestID, int Options);
Parameters
Left
The left edge of the hotspot rectangle
Top
The top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
DestID
The DestID of a destination object
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Return values
0
The DestID property was invalid
1
The link annotation was created successfully
Copyright© 2007-2024 https://loslab.com
AddLinkToEmbeddedFile
Document properties, Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to an embedded file.
Files can be embedded into the PDF using the AddEmbeddedFile function.
Syntax
Delphi
function TPDFlib.AddLinkToEmbeddedFile(Left, Top, Width,
Height: Double; EmbeddedFileID: Integer; Title, Contents: WideString;
IconType, Transpareny: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToEmbeddedFile(
Left As Double, Top As Double, Width As Double,
Height As Double, EmbeddedFileID As Long, Title As String,
Contents As String, IconType As Long,
Transpareny As Long) As Long
DLL
int DLAddLinkToEmbeddedFile(int InstanceID, double Left, double Top,
double Width, double Height, int EmbeddedFileID,
wchar_t * Title, wchar_t * Contents, int IconType,
int Transpareny);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
EmbeddedFileID The value returned from the AddEmbeddedFile function
Title
The title of the attachment that should appear in the PDF viewer.
Contents
The text to use for the contents of the popup
IconType
0 = Standard icon (PushPin)
1 = 28x28 disk image
2 = No icon
3 = Graph
4 = Paperclip
5 = Tag
6 = Solid white rectangle
Transpareny
The transparency percentage to apply ranging from 0 to 100. A value of 0
indicates 0% transparency which is fully opaque (no transparency). A value of
100 indicates 100% transparency which would make the icon invisible.
Return values
0
The EmbeddedFileID parameter was invalid
1
The link was created successfully
Copyright© 2007-2024 https://loslab.com
AddLinkToFile
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to a specific page and position
in another PDF document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToFile(Left, Top, Width,
Height: Double; FileName: WideString; Page: Integer; Position: Double;
NewWindow, Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToFile(Left As Double,
Top As Double, Width As Double, Height As Double,
FileName As String, Page As Long, Position As Double, NewWindow As
Long, Options As Long) As Long
DLL
int DLAddLinkToFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int Page,
double Position, int NewWindow, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The path and file name of the PDF document to link to.
Page
The page in the destination document to link to
Position
The vertical co-ordinate on the destination page to link to
NewWindow
0 = Close the current document and then open the new document
1 = Open the current document in a new window
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddLinkToFileDest
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected named destination which links to a specific page
and position in another PDF document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToFileDest(Left, Top, Width,
Height: Double; FileName, NamedDest: WideString; Position: Double;
NewWindow, Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToFileDest(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, NamedDest As String,
Position As Double, NewWindow As Long, Options As Long) As Long
DLL
int DLAddLinkToFileDest(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName,
wchar_t * NamedDest, double Position, int NewWindow,
int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The path and file name of the PDF document to link to.
NamedDest
The Named Destination string in the destination document to link to
Position
The vertical co-ordinate on the destination page to link to
NewWindow
0 = Close the current document and then open the new document
1 = Open the current document in a new window
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddLinkToFileEx
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to a specific page and position in another PDF document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
The link to the target document is only via the file name. This means the page dimensions of the target document are not known so the
DestLeft, DestTop, DestRight and DestBottom parameters are always specified in points measured from the bottom left corner of the destination
page's MediaBox.
Syntax
Delphi
function TPDFlib.AddLinkToFileEx(Left, Top, Width,
Height: Double; FileName: WideString; DestPage, NewWindow, Options,
Zoom, DestType: Integer; DestLeft, DestTop, DestRight,
DestBottom: Double): Integer;
ActiveX
Function PDFlib::AddLinkToFileEx(Left As Double,
Top As Double, Width As Double, Height As Double,
FileName As String, DestPage As Long, NewWindow As Long, Options As
Long, Zoom As Long, DestType As Long,
DestLeft As Double, DestTop As Double, DestRight As Double, DestBottom
As Double) As Long
DLL
int DLAddLinkToFileEx(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int DestPage,
int NewWindow, int Options, int Zoom, int DestType,
double DestLeft, double DestTop, double DestRight,
double DestBottom);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The path and file name of the PDF document to link to.
DestPage
The page in the destination document to link to
NewWindow
0 = Close the current document and then open the new document
1 = Open the current document in a new window
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Zoom
The zoom percentage to use for the destination object, valid values from 0 to 6400. Only used for DestType = 1, should
be set to 0 for other DestTypes.
DestType
1 = "XYZ" - the target page is positioned at the point specified by the Left and Top parameters. The Zoom parameter
specifies the zoom percentage.
2 = "Fit" - the entire page is zoomed to fit the window. None of the other parameters are used and should be set to zero.
3 = "FitH" - the page is zoomed so that the entire width of the page is visible. The height of the page may be greater or
less than the height of the window. The page is positioned at the vertical position specified by the Top parameter.
4 = "FitV" - the page is zoomed so that the entire height of the page can be seen. The width of the page may be greater
or less than the width of the window. The page is positioned at the horizontal position specified by the Left parameter.
5 = "FitR" - the page is zoomed so that a certain rectangle on the page is visible. The Left, Top, Right and Bottom
parameters define the rectangular area on the page.
6 = "FitB" - the page is zoomed so that it's bounding box is visible.
7 = "FitBH" - the page is positioned vertically at the position specified by the Top parameter. The page is zoomed so that
the entire width of the page's bounding box is visible.
8 = "FitBV" - the page is positioned at the horizontal position specified by the Left parameter. The page is zoomed just
enough to fit the entire height of the bounding box into the window.
DestLeft
The horizontal position used by DestType = 1, 4, 5 and 8
DestTop
The vertical position used by DestType = 1, 3, 5 and 7
DestRight
The horizontal position of the righthand edge of the rectangle. Used by DestType = 5
DestBottom
The horizontal position of the bottom of the rectangle. Used by DestType = 5
Copyright© 2007-2024 https://loslab.com
AddLinkToJavaScript
JavaScript, Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to a JavaScript action.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToJavaScript(Left, Top, Width,
Height: Double; JavaScript: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToJavaScript(
Left As Double, Top As Double, Width As Double,
Height As Double, JavaScript As String, Options As Long) As Long
DLL
int DLAddLinkToJavaScript(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * JavaScript,
int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
JavaScript
The JavaScript to execute.
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddLinkToLocalFile
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to a local file.
The file doesn't have to exist when the PDF is created but should exist when the PDF is viewed for
the link to work.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToLocalFile(Left, Top, Width,
Height: Double; FileName: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToLocalFile(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, Options As Long) As Long
DLL
int DLAddLinkToLocalFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int Options);
Parameters
Left
The left edge of the hotspot rectangle
Top
The top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The relative or absolute path to the local file.
Options
Specifies the appearance of the link and whether the target is opened in a new
window or the same window:
0 = No border, same window
1 = Draw a border, same window
2 = No border, new window
3 = Draw a border, new window
Copyright© 2007-2024 https://loslab.com
AddLinkToPage
Annotations and hotspot links, Page properties
Description
Adds a clickable hotspot rectangle to the selected page which links to another page in the same
document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToPage(Left, Top, Width,
Height: Double; Page: Integer; Position: Double
; Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToPage(Left As Double,
Top As Double, Width As Double, Height As Double,
Page As Long, Position As Double, Options As Long) As Long
DLL
int DLAddLinkToPage(int InstanceID, double Left, double Top,
double Width, double Height, int Page, double Position,
int Options);
Parameters
Left
The left edge of the hotspot rectangle
Top
The top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
Page
The destination page number to link to
Position
The vertical position on the destination page to link to
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddLinkToWeb
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to a URL on the internet.
This can also be used to link to an e-mail address.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToWeb(Left, Top, Width,
Height: Double; Link: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToWeb(Left As Double,
Top As Double, Width As Double, Height As Double,
Link As String, Options As Long) As Long
DLL
int DLAddLinkToWeb(int InstanceID, double Left, double Top, double Width,
double Height, wchar_t * Link, int Options);
Parameters
Left
The left edge of the hotspot rectangle
Top
The top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
Link
The URL to link to. Some examples:
"http://www.example.com/"
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddNoteAnnotation
Annotations and hotspot links
Description
Adds a note annotation to the selected page. The values of the color parameters range from 0 to 1, with 0
indicating 0% and 1 indicating 100% of the color.
Syntax
Delphi
function TPDFlib.AddNoteAnnotation(Left, Top: Double;
AnnotType: Integer; PopupLeft, PopupTop, PopupWidth,
PopupHeight: Double; Title, Contents: WideString; Red, Green,
Blue: Double; Open: Integer): Integer;
ActiveX
Function PDFlib::AddNoteAnnotation(
Left As Double, Top As Double, AnnotType As Long,
PopupLeft As Double, PopupTop As Double, PopupWidth As Double,
PopupHeight As Double, Title As String, Contents As String,
Red As Double, Green As Double, Blue As Double,
Open As Long) As Long
DLL
int DLAddNoteAnnotation(int InstanceID, double Left, double Top,
int AnnotType, double PopupLeft, double PopupTop,
double PopupWidth, double PopupHeight, wchar_t * Title,
wchar_t * Contents, double Red, double Green, double Blue,
int Open);
Parameters
Left
The horizontal co-ordinate of the anchor for the annotation
Top
The vertical co-ordinate of the anchor for the annotation
AnnotType
The annotation type:
0 = Note
1 = Comment
2 = Help
3 = Insert
4 = Key
5 = New paragraph
6 = Paragraph
Add 100 to any of the above values to suppress the date shown in the popup
annotation's title
PopupLeft
The horizontal co-ordinate of the left edge of the popup window
PopupTop
The vertical co-ordinate of the left edge of the popup window
PopupWidth
The width of the popup window
PopupHeight
The height of the popup window
Title
The title of the annotation
Contents
The body of the popup annotation
Red
The red component of the color of the annotation
Green
The green component of the color of the annotation
Blue
The blue component of the color of the annotation
Open
Specifies whether to show the annotation when the document is opened:
0 = hide
1 = show
Copyright© 2007-2024 https://loslab.com
AddOpenTypeFontFromFile
Text, Fonts
Description
This function is identical to AddTrueTypeFontFromFile. Both functions allow a TrueType,
OpenType/TrueType or OpenType/CFF font to be added from a file.
This version of the function provides an Options parameter which may be expanded in future to
support advanced OpenType features.
Syntax
Delphi
function TPDFlib.AddOpenTypeFontFromFile(
FileName: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddOpenTypeFontFromFile(
FileName As String, Options As Long) As Long
DLL
int DLAddOpenTypeFontFromFile(int InstanceID, wchar_t * FileName,
int Options);
Parameters
FileName
The font file name.
Options
Should be set to 0.
Return values
0
The font could not be embedded
Non-zero
The ID of the font that was successfully added. This ID can be used with the
SelectFont function to select the font
Copyright© 2007-2024 https://loslab.com
AddPageLabels
Page properties
Description
Adds a range of page labels to the selected document. A range starting from page 1 must be
present in the document for the page labels to display correctly.
Syntax
Delphi
function TPDFlib.AddPageLabels(Start, Style,
Offset: Integer; Prefix: WideString): Integer;
ActiveX
Function PDFlib::AddPageLabels(Start As Long,
Style As Long, Offset As Long, Prefix As String) As Long
DLL
int DLAddPageLabels(int InstanceID, int Start, int Style, int Offset,
wchar_t * Prefix);
Parameters
Start
The starting page for the range of page labels
Style
0 = No numbers
1 = Decimal arabic numerals
2 = Uppercase roman numerals
3 = Lowercase roman numerals
4 = Uppercase letters (A to Z for first 26 pages, AA to ZZ for next 26, etc.)
5 = Lowercase letters (a to z for first 26 pages, aa to zz for next 26, etc.)
Offset
The value of the numeric portion for the first page label in the range. Subsequent
values will be numbered sequentially from this value, which much be greater than or
equal to 1.
Prefix
The prefix for the page labels in this range.
Return values
0
The Style parameter was out of range
1
The page label range was added successfully
Copyright© 2007-2024 https://loslab.com
AddPageMatrix
Page manipulation
Description
Function will scale the page contents in either direction and also move the page up, down, left or
right. The parameters are in points where 72 points = 1 inch.
xscale = 1, yscale = 1 is the required for 100% scaling.
scale = 2 scale the width by a factor of 2 or 200%
xoffset = 72 moves the page 1 inch to the right. -72 1 inch to the left
yoffset = 72 moves the page 1 up and -72 moves the page 1 inch down
Syntax
Delphi
function TPDFlib.AddPageMatrix(xscale, yscale, xoffset,
yoffset: Double): Integer;
ActiveX
Function PDFlib::AddPageMatrix(xscale As Double,
yscale As Double, xoffset As Double, yoffset As Double) As Long
DLL
int DLAddPageMatrix(int InstanceID, double xscale, double yscale,
double xoffset, double yoffset);
Parameters
xscale
Horizontal scale
yscale
Vertical scale
xoffset
Horizontal offset
yoffset
Vertical offset
Return values
1
Page matrix added successfuly
0
Failed adding page matrix
Copyright© 2007-2024 https://loslab.com
AddRelativeLinkToFile
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links using relative path to a specific
page and position in another PDF document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddRelativeLinkToFile(Left, Top, Width,
Height: Double; FileName: WideString; Page: Integer; Position: Double;
NewWindow, Options: Integer): Integer;
ActiveX
Function PDFlib::AddRelativeLinkToFile(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, Page As Long,
Position As Double, NewWindow As Long, Options As Long) As Long
DLL
int DLAddRelativeLinkToFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int Page,
double Position, int NewWindow, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The full absolute path and file name of the PDF document to link to, it will be
converted to relative path.
Page
The page in the destination document to link to
Position
The vertical co-ordinate on the destination page to link to
NewWindow
0 = Close the current document and then open the new document
1 = Open the current document in a new window
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddRelativeLinkToFileDest
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected named destination which links to a specific page
and position in another PDF document, using relative path.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddRelativeLinkToFileDest(Left, Top, Width,
Height: Double; FileName, NamedDest: WideString; Position: Double;
NewWindow, Options: Integer): Integer;
ActiveX
Function PDFlib::AddRelativeLinkToFileDest(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, NamedDest As String,
Position As Double, NewWindow As Long, Options As Long) As Long
DLL
int DLAddRelativeLinkToFileDest(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName,
wchar_t * NamedDest, double Position, int NewWindow,
int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The full absolute path and file name of the PDF document to link to, it will be
converted to relative path.
NamedDest
The Named Destination string in the destination document to link to
Position
The vertical co-ordinate on the destination page to link to
NewWindow
0 = Close the current document and then open the new document
1 = Open the current document in a new window
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddRelativeLinkToFileEx
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links using relative path to a specific page and position in another PDF document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
The link to the target document is only via the file name. This means the page dimensions of the target document are not known so the
DestLeft, DestTop, DestRight and DestBottom parameters are always specified in points measured from the bottom left corner of the destination
page's MediaBox.
Syntax
Delphi
function TPDFlib.AddRelativeLinkToFileEx(Left, Top, Width,
Height: Double; FileName: WideString; DestPage, NewWindow, Options,
Zoom, DestType: Integer; DestLeft, DestTop, DestRight,
DestBottom: Double): Integer;
ActiveX
Function PDFlib::AddRelativeLinkToFileEx(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, DestPage As Long,
NewWindow As Long, Options As Long, Zoom As Long, DestType As
Long, DestLeft As Double, DestTop As Double, DestRight As
Double, DestBottom As Double) As Long
DLL
int DLAddRelativeLinkToFileEx(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int DestPage,
int NewWindow, int Options, int Zoom, int DestType,
double DestLeft, double DestTop, double DestRight,
double DestBottom);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The full absolute path and file name of the PDF document to link to, it will be converted to relative path.
DestPage
The page in the destination document to link to
NewWindow
0 = Close the current document and then open the new document
1 = Open the current document in a new window
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Zoom
The zoom percentage to use for the destination object, valid values from 0 to 6400. Only used for DestType = 1, should
be set to 0 for other DestTypes.
DestType
1 = "XYZ" - the target page is positioned at the point specified by the Left and Top parameters. The Zoom parameter
specifies the zoom percentage.
2 = "Fit" - the entire page is zoomed to fit the window. None of the other parameters are used and should be set to zero.
3 = "FitH" - the page is zoomed so that the entire width of the page is visible. The height of the page may be greater or
less than the height of the window. The page is positioned at the vertical position specified by the Top parameter.
4 = "FitV" - the page is zoomed so that the entire height of the page can be seen. The width of the page may be greater
or less than the width of the window. The page is positioned at the horizontal position specified by the Left parameter.
5 = "FitR" - the page is zoomed so that a certain rectangle on the page is visible. The Left, Top, Right and Bottom
parameters define the rectangular area on the page.
6 = "FitB" - the page is zoomed so that it's bounding box is visible.
7 = "FitBH" - the page is positioned vertically at the position specified by the Top parameter. The page is zoomed so that
the entire width of the page's bounding box is visible.
8 = "FitBV" - the page is positioned at the horizontal position specified by the Left parameter. The page is zoomed just
enough to fit the entire height of the bounding box into the window.
DestLeft
The horizontal position used by DestType = 1, 4, 5 and 8
DestTop
The vertical position used by DestType = 1, 3, 5 and 7
DestRight
The horizontal position of the righthand edge of the rectangle. Used by DestType = 5
DestBottom
The horizontal position of the bottom of the rectangle. Used by DestType = 5
Copyright© 2007-2024 https://loslab.com
AddRelativeLinkToLocalFile
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links using relative path to a local
file.
The file doesn't have to exist when the PDF is created but should exist when the PDF is viewed for
the link to work.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddRelativeLinkToLocalFile(Left, Top,
Width, Height: Double; FileName: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddRelativeLinkToLocalFile(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, Options As Long) As Long
DLL
int DLAddRelativeLinkToLocalFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the hotspot rectangle
Top
The vertical co-ordinate of the top edge of the hotspot rectangle
Width
The width of the hotspot rectangle
Height
The height of the hotspot rectangle
FileName
The full absolute path and file name of the PDF document to link to, it will be
converted to relative path.
Options
Specifies the appearance of the link:
0 = No border
1 = Draw a border
Copyright© 2007-2024 https://loslab.com
AddSVGAnnotationFromFile
Vector graphics, Image handling, Annotations and hotspot links, Page layout
Description
Adds an SVG file as an annotation to the current page. This is only supported if the PDF is viewed
using Adobe Acrobat 6 or Adobe Reader 6. Earlier and later versions will not show the SVG
annotation.
Syntax
Delphi
function TPDFlib.AddSVGAnnotationFromFile(Left, Top, Width,
Height: Double; FileName: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddSVGAnnotationFromFile(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, Options As Long) As Long
DLL
int DLAddSVGAnnotationFromFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the annotation rectangle
Top
The vertical co-ordinate of the top edge of the annotation rectangle
Width
The width of the annotation rectangle
Height
The height of the annotation rectangle
FileName
The path and name of the file containing the SVG image.
Options
This parameter is ignored and should be set to 0
Return values
0
The SVG file could not be opened
1
The SVG annotation was added successfully
Copyright© 2007-2024 https://loslab.com
AddSWFAnnotationFromFile
Vector graphics, Image handling, Annotations and hotspot links, Page layout
Description
Adds a Flash SWF file as an annotation to the current page.
Syntax
Delphi
function TPDFlib.AddSWFAnnotationFromFile(Left, Top, Width,
Height: Double; FileName, Title: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddSWFAnnotationFromFile(
Left As Double, Top As Double, Width As Double, Height As Double,
FileName As String, Title As String, Options As Long) As Long
DLL
int DLAddSWFAnnotationFromFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName,
wchar_t * Title, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the annotation rectangle
Top
The vertical co-ordinate of the top edge of the annotation rectangle
Width
The width of the annotation rectangle
Height
The height of the annotation rectangle
FileName
The path and name of the SWF file
Title
The annotation title
Options
Annotation event to activate SWF:
0 = Page visible
1 = Mouse enter
2 = Mouse button click
Return values
0
The specified file could not be found
1
The SWF was successfully added as an annotation
Copyright© 2007-2024 https://loslab.com
AddSeparationColor
Vector graphics, Color
Description
Adds a separation color to the document.
A separation color has a name and an equivalent color in the CMYK color space. If the document is
viewed the CMYK color will be used. If the document is printed to an image setter a separation with
the specified name will be generated.
The values of the color parameters range from 0 to 1, with 0 indicating 0% and 1 indicating 100%
of the color.
Syntax
Delphi
function TPDFlib.AddSeparationColor(ColorName: WideString;
C, M, Y, K: Double; Options: Integer): Integer;
ActiveX
Function PDFlib::AddSeparationColor(
ColorName As String, C As Double, M As Double, Y As Double,
K As Double, Options As Long) As Long
DLL
int DLAddSeparationColor(int InstanceID, wchar_t * ColorName, double C,
double M, double Y, double K, int Options);
Parameters
ColorName
The name of the separation color, for example "PANTONE 403 EC". This can be
any name you want, but is usually set to the name of a specific spot color that
your printing press will know what to do with.
C
The cyan component of the color equivalent to the spot color
M
The magenta component of the color equivalent to the spot color
Y
The yellow component of the color equivalent to the spot color
K
The black component of the color equivalent to the spot color
Options
This parameter is ignored and should be set to 0
Return values
0
The separation color could not be added. The color name may already have been
used.
1
The separation color was added successfully
Copyright© 2007-2024 https://loslab.com
AddStampAnnotation
Annotations and hotspot links
Description
Adds a stamp annotation to the selected page. The values of the color parameters range from 0 to 1, with 0 indicating
0% and 1 indicating 100% of the color. The color only affects the background color of the popup and not the stamp
itself.
Syntax
Delphi
function TPDFlib.AddStampAnnotation(Left, Top, Width,
Height: Double; StampType: Integer; Title, Contents: WideString; Red,
Green, Blue: Double; Options: Integer): Integer;
ActiveX
Function PDFlib::AddStampAnnotation(
Left As Double, Top As Double, Width As Double, Height As
Double, StampType As Long, Title As String, Contents As
String, Red As Double, Green As Double, Blue As Double,
Options As Long) As Long
DLL
int DLAddStampAnnotation(int InstanceID, double Left, double Top,
double Width, double Height, int StampType, wchar_t * Title,
wchar_t * Contents, double Red, double Green, double Blue,
int Options);
Parameters
Left
The horizontal coordinate of the left edge of the stamp annotation
Top
The vertical coordinate of the top edge of the stamp annotation
Width
The width of the annotation
Height
The height of the annotation
StampType
0 = Approved
1 = Experimental
2 = NotApproved
3 = AsIs
4 = Expired
5 = NotForPublicRelease
6 = Confidential
7 = Final
8 = Sold
9 = Departmental
10 = ForComment
11 = TopSecret
12 = Draft
13 = ForPublicRelease
Title
The title of the popup annotation
Contents
The contents of the popup annotation
Red
The red component of the popup annotation's background color
Green
The green component of the popup annotation's background color
Blue
The blue component of the popup annotation's background color
Options
Reserved for future use. Should always be set to 0.
Return values
0
The stamp annotation could not be added to the page
1
Success
Copyright© 2007-2024 https://loslab.com
AddStampAnnotationFromImage
Annotations and hotspot links
Description
Adds a custom stamp annotation to the selected page. The values of the color parameters range
from 0 to 1, with 0 indicating 0% and 1 indicating 100% of the color. The color only affects the
background color of the popup and not the stamp itself.
Syntax
Delphi
function TPDFlib.AddStampAnnotationFromImage(Left, Top,
Width, Height: Double; FileName, Title, Contents: WideString; Red,
Green, Blue: Double; Options: Integer): Integer;
ActiveX
Function PDFlib::AddStampAnnotationFromImage(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, Title As String, Contents As
String, Red As Double, Green As Double, Blue As Double, Options As
Long) As Long
DLL
int DLAddStampAnnotationFromImage(int InstanceID, double Left,
double Top, double Width, double Height, wchar_t * FileName,
wchar_t * Title, wchar_t * Contents, double Red, double Green,
double Blue, int Options);
Parameters
Left
The horizontal coordinate of the left edge of the stamp annotation
Top
The vertical coordinate of the top edge of the stamp annotation
Width
The width of the annotation
Height
The height of the annotation
FileName
Complete FilePath to the image
Title
The title of the popup annotation
Contents
The contents of the popup annotation
Red
The red component of the popup annotation's background color
Green
The green component of the popup annotation's background color
Blue
The blue component of the popup annotation's background color
Options
Reserved for future use. Should always be set to 0.
Return values
0
The stamp annotation could not be added to the page
1
Success
Copyright© 2007-2024 https://loslab.com
AddStampAnnotationFromImageID
Annotations and hotspot links
Description
Adds a custom stamp annotation to the selected page based on the image ID that is already added
to the document. The values of the color parameters range from 0 to 1, with 0 indicating 0% and 1
indicating 100% of the color. The color only affects the background color of the popup and not the
stamp itself.
Syntax
Delphi
function TPDFlib.AddStampAnnotationFromImageID(Left, Top,
Width, Height: Double; ImageID: Integer; Title, Contents: WideString;
Red, Green, Blue: Double; Options: Integer): Integer;
ActiveX
Function PDFlib::AddStampAnnotationFromImageID(
Left As Double, Top As Double, Width As Double,
Height As Double, ImageID As Long, Title As String, Contents As String,
Red As Double, Green As Double, Blue As Double, Options As Long) As
Long
DLL
int DLAddStampAnnotationFromImageID(int InstanceID, double Left,
double Top, double Width, double Height, int ImageID,
wchar_t * Title, wchar_t * Contents, double Red, double Green,
double Blue, int Options);
Parameters
Left
The horizontal coordinate of the left edge of the stamp annotation
Top
The vertical coordinate of the top edge of the stamp annotation
Width
The width of the annotation
Height
The height of the annotation
ImageID
ID of the image that should be used as stamp
Title
The title of the popup annotation
Contents
The contents of the popup annotation
Red
The red component of the popup annotation's background color
Green
The green component of the popup annotation's background color
Blue
The blue component of the popup annotation's background color
Options
Reserved for future use. Should always be set to 0.
Return values
0
The stamp annotation could not be added to the page
1
Success
Copyright© 2007-2024 https://loslab.com
AddStandardFont
Text, Fonts
Description
Adds a standard font to the document. These standard fonts will always be available on all PDF
viewers.
Syntax
Delphi
function TPDFlib.AddStandardFont(StandardFontID: Integer): Integer;
ActiveX
Function PDFlib::AddStandardFont(StandardFontID As Long) As Long
DLL
int DLAddStandardFont(int InstanceID, int StandardFontID);
Parameters
StandardFontID
The ID of the font to add:
0 = Courier
1 = CourierBold
2 = CourierBoldOblique
3 = CourierOblique
4 = Helvetica
5 = HelveticaBold
6 = HelveticaBoldOblique
7 = HelveticaOblique
8 = TimesRoman
9 = TimesBold
10 = TimesItalic
11 = TimesBoldItalic
12 = Symbol
13 = ZapfDingbats
Return values
0
The font could not be added
Non-zero
The ID of the font that was successfully added
Copyright© 2007-2024 https://loslab.com
AddSubsettedFont
Text, Fonts
Description
This function is used to embed a "subset" of a font. This means that only the font information for specified
characters is embedded, reducing the size of the document. This function also allows any Unicode character to
be embedded which means that characters from Chinese, Japanese, Korean and other languages can be used.
The newer AddTrueTypeSubsettedFont function provides more advanced font subsetting functionality.
Syntax
Delphi
function TPDFlib.AddSubsettedFont(FontName: WideString;
CharsetIndex: Integer; SubsetChars: WideString): Integer;
ActiveX
Function PDFlib::AddSubsettedFont(FontName As String, CharsetIndex As Long,
SubsetChars As String) As Long
DLL
int DLAddSubsettedFont(int InstanceID, wchar_t * FontName,
int CharsetIndex, wchar_t * SubsetChars);
Parameters
FontName
The name of the TrueType font to install. This can either be the name of the font as shown
in the Windows\Fonts folder (for example "Times New Roman Bold") or it can be the font
family name with an optional style specifier in square brackets (for example "Times New
Roman [BoldItalic]"). Possible optional specifiers are: [Bold], [Italic] or [BoldItalic].
CharsetIndex
You must specify a character set containing the characters you want to subset:
1 = ANSI
2 = Default
3 = Symbol
4 = Shift JIS
5 = Hangeul
6 = GB2312
7 = Chinese Big 5
8 = OEM
9 = Johab
10 = Hebrew
11 = Arabic
12 = Greek
13 = Turkish
14 = Vietnamese
15 = Thai
16 = East Europe
17 = Russian
18 = Mac
19 = Baltic
SubsetChars
A string containing the characters you would like to subset. Repeated characters are
ignored. A maximum of 255 characters can be placed in any font subset. Any Unicode
character can be embedded, but you must ensure that the character is available in the
specified character set.
Return values
0
The subsetted font could not be added or the CharSet parameter was out of range
Non-zero The FontID of the added font. This ID can be used with the SelectFont function to select
the font.
Copyright© 2007-2024 https://loslab.com
AddTextMarkupAnnotation
Annotations and hotspot links
Description
Adds a text markup annotation to the current page.
By default the annotation will consist of a single rectangular area matching the annotation's
bounding box. This area can be edited and other areas can be added using the
GetAnnotQuadCount, GetAnnotQuadPoints and SetAnnotQuadPoints functions.
Syntax
Delphi
function TPDFlib.AddTextMarkupAnnotation(
MarkupType: Integer; Left, Top, Width, Height: Double): Integer;
ActiveX
Function PDFlib::AddTextMarkupAnnotation(
MarkupType As Long, Left As Double, Top As Double,
Width As Double, Height As Double) As Long
DLL
int DLAddTextMarkupAnnotation(int InstanceID, int MarkupType,
double Left, double Top, double Width, double Height);
Parameters
MarkupType
0 = Highlight
1 = Underline
2 = Squiggly
3 = Strike out
Left
The horizontal co-ordinate of the left edge of the annotation bounding box
Top
The vertical co-ordinate of the top edge of the annotation bounding box
Width
The width of the annotation bounding box
Height
The height of the annotation bounding box
Return values
0
The MarkupType parameter was not between 1 and 4.
1
The text markup annotation was added successfully.
Copyright© 2007-2024 https://loslab.com
AddToBuffer
Miscellaneous functions
Description
Adds a block of data to the buffer created with the CreateBuffer function.
This function can be called multiple times until the buffer is full. The return value is the number of
bytes remaining in the buffer.
Syntax
DLL
int DLAddToBuffer(int InstanceID, char * Buffer, char * Source,
int SourceLength);
Parameters
Buffer A value returned from the CreateBuffer function
Source
A pointer to the first byte of data to add
SourceLength
The total number of bytes to copy from the source
Copyright© 2007-2024 https://loslab.com
AddToFileList
Miscellaneous functions
Description
Adds a file to a named file list. This file list can later be used with functions that will operate on all
the files in the list.
Syntax
Delphi
function TPDFlib.AddToFileList(ListName, FileName: WideString): Integer;
ActiveX
Function PDFlib::AddToFileList(
ListName As String, FileName As String) As Long
DLL
int DLAddToFileList(int InstanceID, wchar_t * ListName,
wchar_t * FileName);
Parameters
ListName
The name of the file list to work with
FileName
The file name to add to the list.
Copyright© 2007-2024 https://loslab.com
AddTrueTypeFont
Text, Fonts
Description
Adds a TrueType font to the document. The font must be installed on the system. If the font is not
embedded, then the reader of the PDF document must have the font installed on their system too.
If the font is embedded, then the reader does not need the font installed on their system.
Embedding a font makes the PDF file much larger. Some fonts are not licensed to be embedded.
Syntax
Delphi
function TPDFlib.AddTrueTypeFont(FontName: WideString;
Embed: Integer): Integer;
ActiveX
Function PDFlib::AddTrueTypeFont(FontName As String, Embed As Long) As Long
DLL
int DLAddTrueTypeFont(int InstanceID, wchar_t * FontName, int Embed);
Parameters
FontName
The name of the TrueType font to install. This can either be the name of the font
as shown in the Windows\Fonts folder (for example "Times New Roman") or it can
be the font family name with an optional style specifier in square brackets (for
example "Times New Roman [BoldItalic]").
Possible optional specifiers are: [Bold], [Italic] or [BoldItalic].
A codepage can also be specified (for example "Arial [Bold] {1250}") which allows
other encodings to be used. Possible code pages are:
{0} Direct mapping
{437} OEM_CHARSET
{850} OEM_CHARSET
{852} OEM_CHARSET
{874} THAI_CHARSET
{1250} EASTEUROPE_CHARSET
{1251} RUSSIAN_CHARSET
{1252} ANSI_CHARSET
{1253} GREEK_CHARSET
{1254} TURKISH_CHARSET
{1255} HEBREW_CHARSET
{1256} ARABIC_CHARSET
{1257} BALTIC_CHARSET
{1258} VIETNAMESE_CHARSET
{1361} JOHAB_CHARSET
Embed
Specifies whether to embed the font or not:
0 = Don't embed the font
1 = Embed the font
Return values
0
The font could not be added. This may mean that the font is not licensed to be
embedded, or that the font could not be found.
Non-zero
The ID of the font that was successfully added. This ID can be used with the
SelectFont function to select the font
Copyright© 2007-2024 https://loslab.com
AddTrueTypeFontFromFile
Text, Fonts
Description
Embeds a TrueType, OpenType/TrueType or OpenType/CFF font into the document. The TrueType
font is specified by the file name and does not have to be installed as a system font.
This function is functionally identical to AddOpenTypeFontFromFile.
For TrueType and OpenType/TrueType fonts, a temporary file must be created during this process,
call SetTempPath to specify where this temporary file should be created.
Syntax
Delphi
function TPDFlib.AddTrueTypeFontFromFile(FileName: WideString): Integer;
ActiveX
Function PDFlib::AddTrueTypeFontFromFile(
FileName As String) As Long
DLL
int DLAddTrueTypeFontFromFile(int InstanceID, wchar_t * FileName);
Parameters
FileName
The full path and file name of the TrueType font file to embed.
Return values
0
The font could not be embedded
Non-zero
The ID of the font that was successfully added. This ID can be used with the
SelectFont function to select the font
Copyright© 2007-2024 https://loslab.com
AddTrueTypeSubsettedFont
Text, Fonts
Description
Adds a subsetted TrueType font to the document.
For Options 0 and 1 the font subset is fixed and cannot be changed.
For Options 2 and 3 the font subset can be changed Similar to 0 but subset can be updated using
UpdateTrueTypeSubsettedFont
Syntax
Delphi
function TPDFlib.AddTrueTypeSubsettedFont(FontName,
SubsetChars: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddTrueTypeSubsettedFont(
FontName As String, SubsetChars As String,
Options As Long) As Long
DLL
int DLAddTrueTypeSubsettedFont(int InstanceID, wchar_t * FontName,
wchar_t * SubsetChars, int Options);
Parameters
FontName
The name of the TrueType font that must be subsetted.
SubsetChars
A string containing the characters that should be included in the font subset.
Options
0=MS PlatformID, Unicode charset
1=Unicode PlatformID, "don't care" charset
2=Similar to 0 but subset can be updated using
UpdateTrueTypeSubsettedFont
3=Similar to 1 but subset can be updated using
UpdateTrueTypeSubsettedFont
4=Similar to 2 but subset is automatically updated
5=Similar to 3 but subset is automatically updated
Return values
0
The subsetted font could not be added or the CharSet parameter was out of
range
Non-zero
The ID of the font that was successfully added. This ID can be used with the
SelectFont function to select the font
Copyright© 2007-2024 https://loslab.com
AddType1Font
Text, Fonts
Description
Adds a PostScript Type1 font to the document. The font must be supplied as two files, a .pfm and a
.pfb file. The full path to the .pfm file must be supplied. The font is embedded in the document.
Syntax
Delphi
function TPDFlib.AddType1Font(FileName: WideString): Integer;
ActiveX
Function PDFlib::AddType1Font(FileName As String) As Long
DLL
int DLAddType1Font(int InstanceID, wchar_t * FileName);
Parameters
FileName
The full path to the .pfm file. A .pfb file with the same name should exist in the
same directory as the .pfm file.
Return values
0
The font could not be added. Either the font files are in the wrong format, or they
cannot be found.
Non-zero
The ID of the font that was successfully added. This ID can be used with the
SelectFont function to select the font
Copyright© 2007-2024 https://loslab.com
AddU3DAnnotationFromFile
Vector graphics, Image handling, Annotations and hotspot links, Page layout
Description
Adds an SVG file as an annotation to the current page. The SVG annotation will only be visible if
the PDF is viewed with Adobe Acrobat 7 or higher.
Syntax
Delphi
function TPDFlib.AddU3DAnnotationFromFile(Left, Top, Width,
Height: Double; FileName: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::AddU3DAnnotationFromFile(
Left As Double, Top As Double, Width As Double,
Height As Double, FileName As String, Options As Long) As Long
DLL
int DLAddU3DAnnotationFromFile(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * FileName, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the annotation rectangle
Top
The vertical co-ordinate of the top edge of the annotation rectangle
Width
The width of the annotation rectangle
Height
The height of the annotation rectangle
FileName
The path and name of the file containing the U3D model.
Options
0 = the 3D annotation is static
1 = the 3D annotation is interactive
Copyright© 2007-2024 https://loslab.com
AnalyseFile
Document properties
Description
Analyses a file on disk. The entire file is not loaded into memory so huge files can be examined.
Use the GetAnalysisInfo function to retrieve the individual analysis results. Call DeleteAnalysis
to remove the results from memory when you are finished.
Syntax
Delphi
function TPDFlib.AnalyseFile(InputFileName,
Password: WideString): Integer;
ActiveX
Function PDFlib::AnalyseFile(
InputFileName As String, Password As String) As Long
DLL
int DLAnalyseFile(int InstanceID, wchar_t * InputFileName,
wchar_t * Password);
Parameters
InputFileName
The path and name of the file to analyse.
Password
The password to use when opening the file. This can be either the owner or
the user password. This parameter can be left blank if the file does not
require a password to be opened.
Return values
0 The file could not be analysed. Check the result of the LastErrorCode
function to determine the reason for the failure.
Non-zero The analysis results ID. Pass this to the GetAnalysisInfo function.
Copyright© 2007-2024 https://loslab.com
AnnotationCount
Annotations and hotspot links
Description
Returns the number of annotations on the selected page.
Syntax
Delphi
function TPDFlib.AnnotationCount: Integer;
ActiveX
Function PDFlib::AnnotationCount As Long
DLL
int DLAnnotationCount(int InstanceID);
Copyright© 2007-2024 https://loslab.com
AnsiStringResultLength
Miscellaneous functions
Description
Returns the length of the most recent string returned from the library by all functions that return
8-bit strings.
Syntax
DLL
int DLAnsiStringResultLength(int InstanceID);
Copyright© 2007-2024 https://loslab.com
AppendSpace
Text, Page layout
Description
Moves the current text position horizontally by a percentage of the height of the text.
Syntax
Delphi
function TPDFlib.AppendSpace(RelativeSpace: Double): Integer;
ActiveX
Function PDFlib::AppendSpace(
RelativeSpace As Double) As Long
DLL
int DLAppendSpace(int InstanceID, double RelativeSpace);
Parameters
RelativeSpace
A value of 1 moves the horizontal position by a value equal to the height of
the text at the present font size, also known as an EM space. A value of 0.5
moves the horizontal position by half the height of the text at the present font
size, also known as an EN space.
Copyright© 2007-2024 https://loslab.com
AppendTableColumns
Page layout
Description
Adds columns to the right of the specified table
Syntax
Delphi
function TPDFlib.AppendTableColumns(TableID, NewColumnCount: Integer): Integer;
ActiveX
Function PDFlib::AppendTableColumns(
TableID As Long, NewColumnCount As Long) As Long
DLL
int DLAppendTableColumns(int InstanceID, int TableID, int NewColumnCount);
Parameters
TableID A TableID returned by the CreateTable function
NewColumnCount
The number of columns to add to the table
Return values
0
Columns could not be added. Check the TableID parameter and make
sure NewColumnCount is greater than or equal to 1.
Non-zero
The total number of columns in the table after adding the new columns.
Copyright© 2007-2024 https://loslab.com
AppendTableRows
Page layout
Description
Adds rows to the bottom of the specified table.
Syntax
Delphi
function TPDFlib.AppendTableRows(TableID,
NewRowCount: Integer): Integer;
ActiveX
Function PDFlib::AppendTableRows(TableID As Long,
NewRowCount As Long) As Long
DLL
int DLAppendTableRows(int InstanceID, int TableID, int NewRowCount);
Parameters
TableID A TableID returned by the CreateTable function
NewRowCount
The number of rows to add to the table
Return values
0
Rows could not be added. Check the TableID parameter and make sure
NewRowCount is greater than or equal to 1.
Non-zero
The total number of rows in the table after adding the new rows.
Copyright© 2007-2024 https://loslab.com
AppendText
Text, Page layout
Description
Draws text immediately following text previously drawn with DrawText or AppendText.
Syntax
Delphi
function TPDFlib.AppendText(Text: WideString): Integer;
ActiveX
Function PDFlib::AppendText(
Text As String) As Long
DLL
int DLAppendText(int InstanceID, wchar_t * Text);
Parameters
Text
The text to append to the previously drawn text
Copyright© 2007-2024 https://loslab.com
AppendToFile
Document management
Description
Appends the changed objects to the specified file in an incremental update.
The file name specified should be the same file that was the source of the document in the earlier
call to LoadFromFile, LoadFromString or LoadFromStream.
Appending to a different file will result in a corrupt PDF
.
Syntax
Delphi
function TPDFlib.AppendToFile(FileName: WideString): Integer;
ActiveX
Function PDFlib::AppendToFile(FileName As String) As Long
DLL
int DLAppendToFile(int InstanceID, wchar_t * FileName);
Parameters
FileName
The name of the file to create
Return values
0
The incremental update could not be appended to the specified file
1
Success
Copyright© 2007-2024 https://loslab.com
AppendToString
Document management
Description
Appends the changed objects to a string in an incremental update.
The update must be made to the same input file from a previous call to LoadFromFile,
LoadFromString or LoadFromStream.
The AppendMode parameter can be used to change how the update section is returned. Either form
the original input or from the input set by the SetAppendInputFromString function.
Syntax
Delphi
function TPDFlib.AppendToString(AppendMode: Integer): AnsiString;
DLL
char * DLAppendToString(int InstanceID, int AppendMode);
Parameters
AppendMode
0 = Return original source plus the update section
1 = Return just the update section
2 = Return input string set with SetAppendInputFromString plus the update
section
Copyright© 2007-2024 https://loslab.com
AppendToVariant
Document management
Description
Appends the changed objects to a variant byte array in an incremental update.
The update must be made to the same input file from a previous call to LoadFromFile,
LoadFromVariant or LoadFromStream.
The AppendMode parameter can be used to change how the update section is returned.
Either form the original input or from the input set by the SetAppendInputFromVariant function.
Syntax
ActiveX
Function PDFlib::AppendToVariant(AppendMode As Long) As Variant
Parameters
AppendMode
0 = Return original source plus the update section
1 = Return just the update section
2 = Return input data set with SetAppendInputFromVariant plus the update
section
Copyright© 2007-2024 https://loslab.com
ApplyStyle
Text, Page layout
Description
Applies a style that was previously saved using the SaveStyle function. The style name is case
sensitive, it must exactly match the style name used with the SaveStyle function.
Syntax
Delphi
function TPDFlib.ApplyStyle(StyleName: WideString): Integer;
ActiveX
Function PDFlib::ApplyStyle(StyleName As String) As Long
DLL
int DLApplyStyle(int InstanceID, wchar_t * StyleName);
Parameters
StyleName
The name to associate with the style. This name is case sensitive.
Return values
0
The specified StyleName could not be found
1
The style was applied successfully
Copyright© 2007-2024 https://loslab.com
AttachAnnotToForm
Form fields, Annotations and hotspot links
Description
This functions attaches an annotation to the document form.
Use the IsAnnotFormField function to check if the specified annotation can be attached to the
document form and whether it is currently attached or not.
Syntax
Delphi
function TPDFlib.AttachAnnotToForm(Index: Integer): Integer;
ActiveX
Function PDFlib::AttachAnnotToForm(Index As Long) As Long
DLL
int DLAttachAnnotToForm(int InstanceID, int Index);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Return values
0
The specified annotation could not be attached to the document form.
1
The specified annotation was attached successfully to the document form.
Copyright© 2007-2024 https://loslab.com
BalanceContentStream
Content Streams and Optional Content Groups, Page manipulation
Description
This function combines the content stream parts and surrounds the content stream with "save
graphics state" and "restore graphics state" operators.
If the page contains unbalanced "save graphics state" and "restore graphics state" commands this
function will add extra "restore graphics state" commands at the end of the page to balance the
graphics state stack.
Syntax
Delphi
function TPDFlib.BalanceContentStream: Integer;
ActiveX
Function PDFlib::BalanceContentStream As Long
DLL
int DLBalanceContentStream(int InstanceID);
Copyright© 2007-2024 https://loslab.com
BalancePageTree
Document management, Page properties
Description
Arranges the selected document's internal page structure into a balanced tree for faster random
access to pages in the document.
Syntax
Delphi
function TPDFlib.BalancePageTree(Options: Integer): Integer;
ActiveX
Function PDFlib::BalancePageTree(Options As Long) As Long
DLL
int DLBalancePageTree(int InstanceID, int Options);
Parameters
Options
Reserved for future use, should be set to zero.
Return values
0
The page tree could not be balanced
1
Success
Copyright© 2007-2024 https://loslab.com
BeginPageUpdate
Page layout
Description
For detailed page layouts this function can be called before a group of drawing commands. The
page layout commands will then be buffered until a matching call to the EndPageUpdate function.
Syntax
Delphi
function TPDFlib.BeginPageUpdate: Integer;
ActiveX
Function PDFlib::BeginPageUpdate As Long
DLL
int DLBeginPageUpdate(int InstanceID);
Copyright© 2007-2024 https://loslab.com
CapturePage
Page manipulation
Description
This function "captures" a page. Once the page has been captured it can be drawn onto other
pages. This is useful for combining different pages or for placing more than one original page onto
another page (imposition). Once a page has been captured it is removed from the document. If
you would like the page to remain in the document you must create a blank page and draw the
captured page onto the blank page.
Also, because a document must have at least one page at all times it is not possible to capture a
page if it is the only page in the document. In this case, you must add a new blank page before the
existing page can be captured.
You cannot use CapturePage to move pages from one document to another new document so all
the required pages must be merged into a single document before calling CapturePage. The
CaptureID is just a pointer to a hidden page therefore memory does not need to be released.
The "media box" for the page is used as the bounding rectangle for the captured page. The
CapturePage function can be used in cases where the "crop box" for the page should be used
instead.
Syntax
Delphi
function TPDFlib.CapturePage(Page: Integer): Integer;
ActiveX
Function PDFlib::CapturePage(Page As Long) As Long
DLL
int DLCapturePage(int InstanceID, int Page);
Parameters
Page
The page number to capture. The first page in the document is page 1.
Return values
0
The specified page does not exist, or it is the only page in the document
Non-zero
The ID of the capture process. This ID must be supplied to the
DrawCapturedPage function.
Copyright© 2007-2024 https://loslab.com
CapturePageEx
Page manipulation
Description
This function "captures" a page. Once the page has been captured it can be drawn onto other
pages. This is useful for combining different pages or for placing more than one original page onto
another page (imposition). Once a page has been captured it is removed from the document. If
you would like the page to remain in the document you must create a blank page and draw the
captured page onto the blank page.
Also, because a document must have at least one page at all times it is not possible to capture a
page if it is the only page in the document. In this case, you must add a new blank page before the
existing page can be captured.
You cannot use CapturePage to move pages from one document to another new document so all
the required pages must be merged into a single document before calling CapturePage. The
CaptureID is just a pointer to a hidden page therefore memory does not need to be released.
The "media box" for the page is used as the bounding rectangle for the captured page. The
CapturePageEx function can be used in cases where the "crop box" for the page should be used
instead.
Syntax
Delphi
function TPDFlib.CapturePageEx(Page, Options: Integer): Integer;
ActiveX
Function PDFlib::CapturePageEx(Page As Long,
Options As Long) As Long
DLL
int DLCapturePageEx(int InstanceID, int Page, int Options);
Parameters
Page
The page number to capture. The first page in the document is page 1.
Options
0 = Use the page's media box for the bounding rectangle
1 = Use the page's crop box for the bounding rectangle if it has one, otherwise use
the media box
2 = Use the page's bleed box for the bounding rectangle if it has one, otherwise use
the crop box
3 = Use the page's trim box for the bounding rectangle if it has one, otherwise use
the crop box
4 = Use the page's art box for the bounding rectangle if it has one, otherwise use
the crop box
Return values
0
The specified page does not exist, or it is the only page in the document
Non-zero
The ID of the capture process. This ID must be supplied to the
DrawCapturedPage function.
Copyright© 2007-2024 https://loslab.com
CharWidth
Text, Fonts
Description
Returns the width of a character for the selected font.
This width is returned as a ratio to the text size. For example, if this function returns 750 for a
certain character, then the width of the character for a 12 point font will be (750 / 1000) * 12.
Syntax
Delphi
function TPDFlib.CharWidth(CharCode: Integer): Integer;
ActiveX
Function PDFlib::CharWidth(
CharCode As Long) As Long
DLL
int DLCharWidth(int InstanceID, int CharCode);
Parameters
CharCode
The character to determine the width for. For example, 65 is the character A.
Return values
The width of the specified character. Divide this value by 1000, and multiply by the
text size in points to get the width of the character.
Copyright© 2007-2024 https://loslab.com
CheckFileCompliance
Document manipulation
Description
This function tests a PDF document against various standards to determine compliance with the
standard.
This function is currently under development and currently runs only a small subset of possible
tests.
Syntax
Delphi
function TPDFlib.CheckFileCompliance(InputFileName,
Password: WideString; ComplianceTest, Options: Integer): Integer;
ActiveX
Function PDFlib::CheckFileCompliance(
InputFileName As String, Password As String,
ComplianceTest As Long, Options As Long) As Long
DLL
int DLCheckFileCompliance(int InstanceID, wchar_t * InputFileName,
wchar_t * Password, int ComplianceTest, int Options);
Parameters
InputFileName
The file to check
Password
The password to open the file. If there is no password an empty string
should be used.
ComplianceTest
1 = PDF/A compliance test
Options
For PDF/A compliance test:
0 = Show all errors
1 = Stop after the first error
Return values
0
The file passed the compliance test.
Non-zero A StringListID that can be used with the GetStringListCount and
GetStringListItem functions.
Copyright© 2007-2024 https://loslab.com
CheckObjects
Miscellaneous functions
Description
Checks the file to ensure all objects are valid. This may take some time with large files and
consume large amounts of memory.
Syntax
Delphi
function TPDFlib.CheckObjects: Integer;
ActiveX
Function PDFlib::CheckObjects As Long
DLL
int DLCheckObjects(int InstanceID);
Copyright© 2007-2024 https://loslab.com
CheckPageAnnots
Annotations and hotspot links, Miscellaneous functions
Description
Checks all the annotations on the selected page and ensures that they are all valid. Invalid
annotations are removed from the page.
Syntax
Delphi
function TPDFlib.CheckPageAnnots: Integer;
ActiveX
Function PDFlib::CheckPageAnnots As Long
DLL
int DLCheckPageAnnots(int InstanceID);
Return values
0
No annotations were found to be in an incorrect format
1
One or more annotations were not in the correct format and were unlinked from the
page
Copyright© 2007-2024 https://loslab.com
CheckPassword
Security and Signatures
Description
Determines if a password is a valid password for the selected document.
This is useful when the document has been opened with the user password but confirmation should
be obtained from the user before changing security settings.
Syntax
Delphi
function TPDFlib.CheckPassword(
Password: WideString): Integer;
ActiveX
Function PDFlib::CheckPassword(
Password As String) As Long
DLL
int DLCheckPassword(int InstanceID, wchar_t * Password);
Parameters
Password
The password to check
Return values
0
The document is not encrypted or the supplied password is not a valid owner or
user password
1
Valid user password
2
Valid owner password
3
Valid owner and user password
Copyright© 2007-2024 https://loslab.com
ClearFileList
Miscellaneous functions
Description
Clears a named file list.
Syntax
Delphi
function TPDFlib.ClearFileList(ListName: WideString): Integer;
ActiveX
Function PDFlib::ClearFileList(ListName As String) As Long
DLL
int DLClearFileList(int InstanceID, wchar_t * ListName);
Parameters
ListName
The name of the file list to clear
Return values
0
The named list could not be found
1
The named list was cleared successfully
Copyright© 2007-2024 https://loslab.com
ClearImage
Image handling
Description
Clears the specified image.
To prevent the corruption of existing links to the image it will not be deleted from the document.
The image will be converted into a 24-bit RGB format consisting of a single transparent pixel.
Syntax
Delphi
function TPDFlib.ClearImage(ImageID: Integer): Integer;
ActiveX
Function PDFlib::ClearImage(
ImageID As Long) As Long
DLL
int DLClearImage(int InstanceID, int ImageID);
Parameters
ImageID
The ImageID of the image to be cleared
Return values
0
The specified ImageID was not valid
1
The image was cleared
Copyright© 2007-2024 https://loslab.com
ClearPageLabels
Page properties
Description
Removes all the page labels from the selected document.
Syntax
Delphi
function TPDFlib.ClearPageLabels: Integer;
ActiveX
Function PDFlib::ClearPageLabels As Long
DLL
int DLClearPageLabels(int InstanceID);
Copyright© 2007-2024 https://loslab.com
ClearTextFormatting
Text
Description
Clears any formatting that has been applied. Subsequently drawn text will be drawn left aligned in
black with all highlighting, underlining, character spacing, word spacing, horizontal scaling and
vertical spacing removed.
Syntax
Delphi
function TPDFlib.ClearTextFormatting: Integer;
ActiveX
Function PDFlib::ClearTextFormatting As Long
DLL
int DLClearTextFormatting(int InstanceID);
Copyright© 2007-2024 https://loslab.com
CloneOutlineAction
Annotations and hotspot links, Outlines
Description
Calling this function will clone the action dictionary of the specified outline. This is useful when an
outline and an annotation share the same action dictionary and the actions must be set
individually.
Syntax
Delphi
function TPDFlib.CloneOutlineAction(
OutlineID: Integer): Integer;
ActiveX
Function PDFlib::CloneOutlineAction(
OutlineID As Long) As Long
DLL
int DLCloneOutlineAction(int InstanceID, int OutlineID);
Parameters
OutlineID The ID of the outline as returned by the NewOutline function. Alternatively, use
the GetOutlineID function to get a valid outline ID.
Copyright© 2007-2024 https://loslab.com
ClonePages
Page manipulation
Description
Copies pages from the document multiple times, with only a negligible increase in file size. Note
that only the first "layer" of the page is cloned. Unless you specifically want to take part of the
page you should call CombineContentStreams for all the pages you want to clone before calling
this function.
Syntax
Delphi
function TPDFlib.ClonePages(StartPage, EndPage,
RepeatCount: Integer): Integer;
ActiveX
Function PDFlib::ClonePages(StartPage As Long,
EndPage As Long, RepeatCount As Long) As Long
DLL
int DLClonePages(int InstanceID, int StartPage, int EndPage,
int RepeatCount);
Parameters
StartPage
The first page to clone
EndPage
The last page to clone
RepeatCount
The number of times to clone the pages
Return values
0
The parameters were out of range
1
The function was successful
Copyright© 2007-2024 https://loslab.com
CloseOutline
Outlines
Description
Collapses an outline item (bookmark).
Syntax
Delphi
function TPDFlib.CloseOutline(OutlineID: Integer): Integer;
ActiveX
Function PDFlib::CloseOutline(OutlineID As Long) As Long
DLL
int DLCloseOutline(int InstanceID, int OutlineID);
Parameters
OutlineID The ID of the outline as returned by the NewOutline function. Alternatively, use
the GetOutlineID function to get a valid outline ID.
Return values
0
The Outline ID provided was invalid
1
The outline item was collapsed
Copyright© 2007-2024 https://loslab.com
ClosePath
Vector graphics, Path definition and drawing
Description
Closes the path defined by calls to StartPath, AddLineToPath, and AddCurveToPath. A line is
drawn from the last point to the first point.
Syntax
Delphi
function TPDFlib.ClosePath: Integer;
ActiveX
Function PDFlib::ClosePath As Long
DLL
int DLClosePath(int InstanceID);
Copyright© 2007-2024 https://loslab.com
CombineContentStreams
Content Streams and Optional Content Groups
Description
A page in a PDF document has one or more content stream parts that together contain all the PDF
page description commands for the page.
This function combines all the content stream parts of the selected page into a single content
stream.
Syntax
Delphi
function TPDFlib.CombineContentStreams: Integer;
ActiveX
Function PDFlib::CombineContentStreams As Long
DLL
int DLCombineContentStreams(int InstanceID);
Return values
0
The content stream could not be combined
1
The content stream was combined successfully
Copyright© 2007-2024 https://loslab.com
CompareOutlines
Outlines
Description
Compares two OutlineID values.
Syntax
Delphi
function TPDFlib.CompareOutlines(FirstOutlineID,
SecondOutlineID: Integer): Integer;
ActiveX
Function PDFlib::CompareOutlines(
FirstOutlineID As Long, SecondOutlineID As Long) As Long
DLL
int DLCompareOutlines(int InstanceID, int FirstOutlineID,
int SecondOutlineID);
Parameters
FirstOutlineID
The first OutlineID to compare
SecondOutlineID
The second OutlineID to compare
Return values
0
One or both of the OutlineID values were not valid or there is no
relationship between the two outlines.
1
The OutlineID values refer to the same outline item.
Copyright© 2007-2024 https://loslab.com
CompressContent
Document properties
Description
Compresses the content of the selected document. The Flate algorithm is used to compress the
content.
Syntax
Delphi
function TPDFlib.CompressContent: Integer;
ActiveX
Function PDFlib::CompressContent As Long
DLL
int DLCompressContent(int InstanceID);
Return values
0
The content could not be compressed
1
The content was compressed successfully
Copyright© 2007-2024 https://loslab.com
CompressFonts
Fonts, Document properties
Description
Specifies whether or not to compress TrueType, Packaged and Type1 fonts subsequently added to
the document.
Syntax
Delphi
function TPDFlib.CompressFonts(Compress: Integer): Integer;
ActiveX
Function PDFlib::CompressFonts(
Compress As Long) As Long
DLL
int DLCompressFonts(int InstanceID, int Compress);
Parameters
Compress
0 = Don't compress fonts
1 = Compress all subsequently added fonts
Return values
0
The Compress parameter was out of range
1
The font compression setting was changed successfully
Copyright© 2007-2024 https://loslab.com
CompressImages
Image handling, Document properties
Description
Specifies the compression to use for images added to the document.
Syntax
Delphi
function TPDFlib.CompressImages(Compress: Integer): Integer;
ActiveX
Function PDFlib::CompressImages(
Compress As Long) As Long
DLL
int DLCompressImages(int InstanceID, int Compress);
Parameters
Compress
0 = No compression
1 = Flate compression
Return values
0
The Compress parameter was not valid
1
The image compression was set successfully
Copyright© 2007-2024 https://loslab.com
CompressPage
Page properties
Description
This function is similar to the CompressContent function, however it only compresses the
selected page. Looping through all the pages using this function will have the same effect as
CompressContent, however it will be possible to provide feedback to the user.
Syntax
Delphi
function TPDFlib.CompressPage: Integer;
ActiveX
Function PDFlib::CompressPage As Long
DLL
int DLCompressPage(int InstanceID);
Copyright© 2007-2024 https://loslab.com
ContentStreamCount
Content Streams and Optional Content Groups
Description
A page in a PDF document has one or more content stream parts that together contain all the PDF
page description commands for the page.
This function returns the total number of content stream parts for the selected page
.
Syntax
Delphi
function TPDFlib.ContentStreamCount: Integer;
ActiveX
Function PDFlib::ContentStreamCount As Long
DLL
int DLContentStreamCount(int InstanceID);
Return values
The number of content stream parts on the selected page
Copyright© 2007-2024 https://loslab.com
ContentStreamSafe
Content Streams and Optional Content Groups
Description
A page in a PDF document has one or more content stream parts that together contain all the PDF
page description commands for the page.
This function determines if the content stream part that was selected using the
SelectContentStream function was created by
loslab PDF Library or not.
Only content stream parts created by
loslab PDF Library should be considered "safe" to drawn on.
If a content stream part is not safe it would be best to combine all the content stream parts using
the CombineContentStreams function before drawing on the page to prevent later errors in the
document.
Syntax
Delphi
function TPDFlib.ContentStreamSafe: Integer;
ActiveX
Function PDFlib::ContentStreamSafe As Long
DLL
int DLContentStreamSafe(int InstanceID);
Return values
0
The layer was not created by
loslab PDF Library and care should be taken
when drawing onto this layer
1
The layer was created by loslab PDF Library and is safe to draw on
Copyright© 2007-2024 https://loslab.com
CopyPageRanges
Extraction, Page manipulation
Description
Use this function to copy one or more pages from one document to another.
The pages are copied in sequential order and duplicates are not allowed. To extract pages in a
different order to the source document or with duplicate pages the CopyPageRangesEx function
can be used.
Syntax
Delphi
function TPDFlib.CopyPageRanges(DocumentID: Integer;
RangeList: WideString): Integer;
ActiveX
Function PDFlib::CopyPageRanges(
DocumentID As Long, RangeList As String) As Long
DLL
int DLCopyPageRanges(int InstanceID, int DocumentID, wchar_t * RangeList);
Parameters
DocumentID
The ID of the document to copy the pages from
RangeList
The pages to extract, for example "10,15,18-20,25-35". Invalid characters and
duplicate page numbers in the string will be ignored. Reversed page ranges
such as "5-1" will be accepted. The list of pages will be sorted resulting in the
pages being extracted in numerical order.
Return values
0
The specified DocumentID was not valid or was the same as the selected
document, or the RangeList was invalid
1
The pages were successfully copied from the specified document to the selected
document
Copyright© 2007-2024 https://loslab.com
CopyPageRangesEx
Extraction, Page manipulation
Description
Use this function to copy one or more pages from one document to another. It is functionality
identical to the CopyPageRanges function but adds an option to allow the page list to contain
duplicate page numbers and a different page order to the original document.
Syntax
Delphi
function TPDFlib.CopyPageRangesEx(DocumentID: Integer;
RangeList: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::CopyPageRangesEx(
DocumentID As Long, RangeList As String,
Options As Long) As Long
DLL
int DLCopyPageRangesEx(int InstanceID, int DocumentID,
wchar_t * RangeList, int Options);
Parameters
DocumentID
The ID of the document to copy the pages from
RangeList
The pages to extract, for example "10,15,18-20,25-35". Invalid characters in
the string will be ignored.
Options 0 = Identical behaviour to the CopyPageRanges function. The page list is
sorted and duplicate page numbers are ignored.
1 = Do not sort the page list and allow duplicate page numbers
Return values
0
The specified DocumentID was not valid or was the same as the selected
document, or the RangeList was invalid
1
The pages were successfully copied from the specified document to the selected
document
Copyright© 2007-2024 https://loslab.com
CreateBuffer
Miscellaneous functions
Description
Creates a buffer that can be used to send strings to PDF Library DLL containing null characters.
Once the buffer has been created, use the AddToBuffer function to add data to the buffer. The
data can be added to the buffer in one call, or chunks of data can be sent one at a time until the
buffer is full.
When you are finished with the buffer, call the ReleaseBuffer function to release it.
Syntax
DLL
char * DLCreateBuffer(int InstanceID, int BufferLength);
Parameters
BufferLength
The size in bytes of the buffer that must be created
Return values
0
The BufferLength value was less than 1, or the InstanceID was invalid
Non-zero
A PChar that can be passed as any string parameter to other functions
Copyright© 2007-2024 https://loslab.com
CreateLibrary
Miscellaneous functions
Description
Call this function to create an instance
of PDF Library in the DLL. The value returned is used as
the InstanceID parameter of all the other functions.
Call the ReleaseLibrary function to free the the instance when you are finished with it
.
Syntax
DLL
int DLCreateLibrary(int InstanceID);
Return values
0
An instance of PDF Library could not be created
Non-zero
An InstanceID value that can be used with other functions
Copyright© 2007-2024 https://loslab.com
CreateNewObject
Miscellaneous functions
Description
Adds a new PDF object to the document. The contents of the object can be set using the
SetObjectFromString function.
Syntax
Delphi
function TPDFlib.CreateNewObject: Integer;
ActiveX
Function PDFlib::CreateNewObject As Long
DLL
int DLCreateNewObject(int InstanceID);
Return values
Non-zero
The object number of the newly created object
Copyright© 2007-2024 https://loslab.com
CreateTable
Page layout
Description
Creates a table with the specified number of rows and columns. Use the other table functions to set
up the table and then use DrawTableRows to draw the table onto the page.
Syntax
Delphi
function TPDFlib.CreateTable(RowCount,
ColumnCount: Integer): Integer;
ActiveX
Function PDFlib::CreateTable(RowCount As Long,
ColumnCount As Long) As Long
DLL
int DLCreateTable(int InstanceID, int RowCount, int ColumnCount);
Parameters
RowCount
The number of rows that the new table should have
ColumnCount
The number of columns that the new table should have.
Return values
0
The table could not be created. Row and column count must be greater or
equal to 1.
Non-zero
A TableID that can be used with the other table functions.
Copyright© 2007-2024 https://loslab.com
DAAppendFile
Document management, Direct access functionality
Description
Appends any changes made to a document originally opened using the DAOpenFile function. This
is a fast operation because only the changed objects must be added to the end of the original file.
The file is closed after this operation and the file handle will no longer be valid.
This function will not work if the source file was opened in read only mode or if the document was
loaded from a malformed file for example where whitespace was added to the start of the file. In
these cases the DASaveAsFile function should be used instead.
Syntax
Delphi
function TPDFlib.DAAppendFile(FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DAAppendFile(
FileHandle As Long) As Long
DLL
int DLDAAppendFile(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Return values
0
The specified FileHandle was not valid
1
The changes to the file were appended successfully
2
The file was opened in read only mode and the update cannot be written. Use
DASaveAsFile instead.
3
The document was opened from a malformed file and an append operation is not
possible. See the DAShiftedHeader function.
Copyright© 2007-2024 https://loslab.com
DACapturePage
Direct access functionality, Page manipulation
Description
This function "captures" the specified page from a document originally opened with DAOpenFile.
The captured page can then be drawn onto any other page using the DADrawCapturedPage
function. This is useful for combining different pages or for placing more than one original page
onto another page (imposition).
Once a page has been captured it is removed from the document. If you would like the page to
remain in the document you must create a blank page and draw the captured page onto the blank
page.
The "media box" for the page is used as the bounding rectangle for the capture page. The
DACapturePageEx function can be used in cases where the "crop box" for the page should be
used instead.
Syntax
Delphi
function TPDFlib.DACapturePage(FileHandle,
PageRef: Integer): Integer;
ActiveX
Function PDFlib::DACapturePage(
FileHandle As Long, PageRef As Long) As Long
DLL
int DLDACapturePage(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Return values
0
The specified FileHandle or PageRef were not valid
Non-zero An ID that can be used with the DADrawCapturedPage function
Copyright© 2007-2024 https://loslab.com
DACapturePageEx
Direct access functionality, Page manipulation
Description
Captures the specified page from a document originally opened with DAOpenFile. The captured
page is hidden, but can then be drawn onto any other page using the DADrawCapturedPage
function. The "media box" for the page is used as the bounding rectangle for the capture page. The
DACapturePageEx function can be used in cases where the "crop box" for the page should be
used instead.
Syntax
Delphi
function TPDFlib.DACapturePageEx(FileHandle, PageRef,
Options: Integer): Integer;
ActiveX
Function PDFlib::DACapturePageEx(
FileHandle As Long, PageRef As Long, Options As Long) As Long
DLL
int DLDACapturePageEx(int InstanceID, int FileHandle, int PageRef,
int Options);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef
A page reference returned by the DAFindPage or DANewPage functions
Options
0 = Use the page's media box for the bounding rectangle
1 = Use the page's crop box for the bounding rectangle if it has one, otherwise
use the media box
2 = Use the page's bleed box for the bounding rectangle if it has one, otherwise
use the crop box
3 = Use the page's trim box for the bounding rectangle if it has one, otherwise
use the crop box
4 = Use the page's art box for the bounding rectangle if it has one, otherwise use
the crop box
Return values
0
The specified FileHandle or PageRef were not valid, or the specified page was the
only page in the document
Non-zero An ID that can be used with the DADrawCapturedPage function
Copyright© 2007-2024 https://loslab.com
DACloseFile
Direct access functionality
Description
Closes a file that was originally opened using the DAOpenFile function. Any changes made to the
file are lost. If you would like to keep your changes you must use either the DASaveAsFile
function or the DAAppendFile function before closing the file.
Syntax
Delphi
function TPDFlib.DACloseFile(FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DACloseFile(
FileHandle As Long) As Long
DLL
int DLDACloseFile(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Return values
0
The specified FileHandle was not valid, the file may already have been closed
1
The file was closed successfully
Copyright© 2007-2024 https://loslab.com
DADrawCapturedPage
Direct access functionality, Page layout
Description
Draws a page originally captured using the DrawCapturedPage function onto the specified page.
The original page must have been captured from the same document (having the same
FileHandle).
Syntax
Delphi
function TPDFlib.DADrawCapturedPage(FileHandle, DACaptureID,
DestPageRef: Integer; PntLeft, PntBottom, PntWidth,
PntHeight: Double): Integer;
ActiveX
Function PDFlib::DADrawCapturedPage( FileHandle As Long,
DACaptureID As Long, DestPageRef As Long, PntLeft As Double,
PntBottom As Double, PntWidth As Double, PntHeight As Double)
As Long
DLL
int DLDADrawCapturedPage(int InstanceID, int FileHandle, int DACaptureID,
int DestPageRef, double PntLeft, double PntBottom,
double PntWidth, double PntHeight);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
DACaptureID A capture ID returned by the DACapturePage function
DestPageRef A page reference returned by the DAFindPage or DANewPage functions
PntLeft
The horizontal co-ordinate of the left edge of the destination rectangle,
measured in points from the left edge of the page
PntBottom
The vertical co-ordinate of the bottom edge of the destination rectangle,
measured in points from the bottom edge of the page
PntWidth
The width of the destination rectangle, measured in points
PntHeight
The height of the destination rectangle, measured in points
Return values
0
The specified FileHandle, PageRef or DACaptureID were not valid
1
The captured page was drawn successfully
Copyright© 2007-2024 https://loslab.com
DADrawRotatedCapturedPage
Direct access functionality, Page layout
Description
Similar to the DADrawCapturedPage function but allows the captured page to be drawn at any
angle.
Syntax
Delphi
function TPDFlib.DADrawRotatedCapturedPage(FileHandle,
DACaptureID, DestPageRef: Integer; PntLeft, PntBottom, PntWidth,
PntHeight, Angle: Double): Integer;
ActiveX
Function PDFlib::DADrawRotatedCapturedPage(
FileHandle As Long, DACaptureID As Long, DestPageRef As Long,
PntLeft As Double, PntBottom As Double, PntWidth As Double,
PntHeight As Double, Angle As Double) As Long
DLL
int DLDADrawRotatedCapturedPage(int InstanceID, int FileHandle,
int DACaptureID, int DestPageRef, double PntLeft,
double PntBottom, double PntWidth, double PntHeight,
double Angle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
DACaptureID
A capture ID returned by the DACapturePage function
DestPageRef A page reference returned by the DAFindPage or DANewPage functions
PntLeft
The horizontal co-ordinate of the left edge of the destination rectangle,
measured in points from the left edge of the page
PntBottom
The vertical co-ordinate of the bottom edge of the destination rectangle,
measured in points from the bottom edge of the page
PntWidth
The width of the destination rectangle, measured in points
PntHeight
The height of the destination rectangle, measured in points
Angle
The angle to rotate the captured page by, measured anti-clockwise in degrees
from the baseline
Return values
0
The specified FileHandle, PageRef or DACaptureID were not valid
1
The captured page was drawn successfully
Copyright© 2007-2024 https://loslab.com
DAEmbedFileStreams
Document manipulation, Direct access functionality
Description
Converts any stream object where the data is stored in an external file into a regular embedded
stream object.
Syntax
Delphi
function TPDFlib.DAEmbedFileStreams(FileHandle: Integer;
RootPath: WideString): Integer;
ActiveX
Function PDFlib::DAEmbedFileStreams(
FileHandle As Long, RootPath As String) As Long
DLL
int DLDAEmbedFileStreams(int InstanceID, int FileHandle,
wchar_t * RootPath);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
RootPath
The directory to use as the root for relative paths.
Copyright© 2007-2024 https://loslab.com
DAExtractPageText
Extraction, Direct access functionality, Page manipulation
Description
This function provides two different methods for extracting text from the selected page, and
presents the results in a variety of formats.
The DASetTextExtractionWordGap, DASetTextExtractionOptions and
DASetTextExtractionArea functions can be used to adjust the text extraction process.
Syntax
Delphi
function TPDFlib.DAExtractPageText(FileHandle, PageRef,
Options: Integer): WideString;
ActiveX
Function PDFlib::DAExtractPageText(
FileHandle As Long, PageRef As Long, Options As Long) As String
DLL
wchar_t * DLDAExtractPageText(int InstanceID, int FileHandle,
int PageRef, int Options);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Options
Using the standard text extraction algorithm:
0 = Extract text in human readable format
1 = Deprecated
2 = Return a CSV string including font, color, size and position of each piece of
text on the page
Using the more accurate but slower text extraction algorithm:
3 = Return a CSV string for each piece of text on the page with the following
format:
Font Name, Text Color, Text Size, X1, Y1, X2, Y2, X3, Y3, X4, Y4, Text
The co-ordinates are the four points bounding the text, measured using the units
set with the SetMeasurementUnits function and the origin set with the
SetOrigin function. Co-ordinate order is anti-clockwise with the bottom left
corner first.
4 = Similar to option 3, but individual words are returned, making searching for
words easier
5 = Similar to option 3 but character widths are output after each block of text
6 = Similar to option 4 but character widths are output after each line of text
7 = Extract text in human readable format with improved accuracy compared to
option 0
8 = Similar output format as option 0 but using the more accurate algorithm.
Returns unformatted lines.
Copyright© 2007-2024 https://loslab.com
DAExtractPageTextBlocks
Text, Extraction, Direct access functionality
Description
Similar to the DAExtractPageText function but the results are stored in a text block list rather
than returned as a CSV string.
Once the results are in the text block list, functions such as DAGetTextBlockCount,
DAGetTextBlockText and DAGetTextBlockColor can be used to retrieve the properties of each
block of text.
Syntax
Delphi
function TPDFlib.DAExtractPageTextBlocks(FileHandle,
PageRef, ExtractOptions: Integer): Integer;
ActiveX
Function PDFlib::DAExtractPageTextBlocks(
FileHandle As Long, PageRef As Long,
ExtractOptions As Long) As Long
DLL
int DLDAExtractPageTextBlocks(int InstanceID, int FileHandle,
int PageRef, int ExtractOptions);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
ExtractOptions
3 = Normal extraction
4 = Split words
Return values
0
Text could not be extracted from the page
Non-zero
A TextBlockListID value
Copyright© 2007-2024 https://loslab.com
DAFindPage
Direct access functionality
Description
Use this function to obtain a page reference for use with other Direct Access functions. This page
reference will remain constant even if other pages are added to or removed from the document.
Syntax
Delphi
function TPDFlib.DAFindPage(FileHandle,
Page: Integer): Integer;
ActiveX
Function PDFlib::DAFindPage(FileHandle As Long,
Page As Long) As Long
DLL
int DLDAFindPage(int InstanceID, int FileHandle, int Page);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Page
The page number. The first page in the document has a page number of 1.
Return values
0
The specified FileHandle was not valid or the Page parameter was out of range
Non-zero
An ID that can be used as the PageRef parameter for any of the direct access
functions
Copyright© 2007-2024 https://loslab.com
DAGetAnnotationCount
Direct access functionality
Description
Returns the number of annotations on the specified page
.
Syntax
Delphi
function TPDFlib.DAGetAnnotationCount(FileHandle,
PageRef: Integer): Integer;
ActiveX
Function PDFlib::DAGetAnnotationCount(
FileHandle As Long, PageRef As Long) As Long
DLL
int DLDAGetAnnotationCount(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Copyright© 2007-2024 https://loslab.com
DAGetFormFieldCount
Form fields, Direct access functionality
Description
Returns the number of form fields in the document.
Syntax
Delphi
function TPDFlib.DAGetFormFieldCount(
FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DAGetFormFieldCount(
FileHandle As Long) As Long
DLL
int DLDAGetFormFieldCount(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Copyright© 2007-2024 https://loslab.com
DAGetFormFieldTitle
Form fields, Direct access functionality
Description
Returns the title of the specified form field.
Syntax
Delphi
function TPDFlib.DAGetFormFieldTitle(FileHandle,
FieldIndex: Integer): WideString;
ActiveX
Function PDFlib::DAGetFormFieldTitle(
FileHandle As Long, FieldIndex As Long) As String
DLL
wchar_t * DLDAGetFormFieldTitle(int InstanceID, int FileHandle,
int FieldIndex);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
FieldIndex
The index of the form field to work with. The first form field has an index of 1.
Copyright© 2007-2024 https://loslab.com
DAGetFormFieldValue
Form fields, Direct access functionality
Description
Returns the value of the specified form field.
Syntax
Delphi
function TPDFlib.DAGetFormFieldValue(FileHandle,
FieldIndex: Integer): WideString;
ActiveX
Function PDFlib::DAGetFormFieldValue(
FileHandle As Long, FieldIndex As Long) As String
DLL
wchar_t * DLDAGetFormFieldValue(int InstanceID, int FileHandle,
int FieldIndex);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
FieldIndex
The index of the form field to work with. The first form field has an index of 1.
Copyright© 2007-2024 https://loslab.com
DAGetImageDataToString
Image handling, Direct access functionality
Description
Returns the image data of an image in an image list.
The format of the data depends on the type of the image.
The DAGetImageIntProperty function can be used to determine the image type.
Syntax
Delphi
function TPDFlib.DAGetImageDataToString(FileHandle,
ImageListID, ImageIndex: Integer): AnsiString;
DLL
char * DLDAGetImageDataToString(int InstanceID, int FileHandle,
int ImageListID, int ImageIndex);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID A value returned by the DAGetPageImageList function
ImageIndex
The index of the image. The first image in the list has an index of 1. Use the
DAGetImageListCount function to determine the number of images in the
list.
Copyright© 2007-2024 https://loslab.com
DAGetImageDataToVariant
Image handling, Direct access functionality
Description
Returns the image data of an image in an image list as a byte array variant.
The format of the data depends on the type of the image.
The DAGetImageIntProperty function can be used to determine the image type.
Syntax
ActiveX
Function PDFlib::DAGetImageDataToVariant(
FileHandle As Long, ImageListID As Long,
ImageIndex As Long) As Variant
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID A value returned by the DAGetPageImageList function
ImageIndex
The index of the image. The first image in the list has an index of 1. Use the
DAGetImageListCount function to determine the number of images in the
list.
Copyright© 2007-2024 https://loslab.com
DAGetImageDblProperty
Image handling, Direct access functionality
Description
Returns certain properties of an image in an image list.
Syntax
Delphi
function TPDFlib.DAGetImageDblProperty(FileHandle,
ImageListID, ImageIndex, PropertyID: Integer): Double;
ActiveX
Function PDFlib::DAGetImageDblProperty(
FileHandle As Long, ImageListID As Long, ImageIndex As Long,
PropertyID As Long) As Double
DLL
double DLDAGetImageDblProperty(int InstanceID, int FileHandle,
int ImageListID, int ImageIndex, int PropertyID);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID A value returned by the DAGetPageImageList function
ImageIndex
The index of the image. The first image in the list has an index of 1. Use the
DAGetImageListCount function to determine the number of images in the
list.
PropertyID
501 = Horizontal co-ordinate of top-left corner
502 = Vertical co-ordinate of top-left corner
503 = Horizontal co-ordinate of top-right corner
504 = Vertical co-ordinate of top-right corner
505 = Horizontal co-ordinate of bottom-right corner
506 = Vertical co-ordinate of bottom-right corner
507 = Horizontal co-ordinate of bottom-left corner
508 = Vertical co-ordinate of bottom-left corner
Copyright© 2007-2024 https://loslab.com
DAGetImageIntProperty
Image handling, Direct access functionality
Description
Returns certain properties of an image in an image list.
Syntax
Delphi
function TPDFlib.DAGetImageIntProperty(FileHandle,
ImageListID, ImageIndex, PropertyID: Integer): Integer;
ActiveX
Function PDFlib::DAGetImageIntProperty(
FileHandle As Long, ImageListID As Long, ImageIndex As Long,
PropertyID As Long) As Long
DLL
int DLDAGetImageIntProperty(int InstanceID, int FileHandle,
int ImageListID, int ImageIndex, int PropertyID);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID
A value returned by the DAGetPageImageList function
ImageIndex
The index of the image. The first image in the list has an index of 1. Use the
DAGetImageListCount function to determine the number of images in the
list.
PropertyID 400 = Image type (see ImageType) for values
401 = Width in pixels
402 = Height in pixels
403 = Bits per pixel
404 = Color space type
405 = Image ID (will be 0 if it is an Inline image)
Copyright© 2007-2024 https://loslab.com
DAGetImageListCount
Image handling, Direct access functionality
Description
Returns the number of images in an image list.
Syntax
Delphi
function TPDFlib.DAGetImageListCount(FileHandle,
ImageListID: Integer): Integer;
ActiveX
Function PDFlib::DAGetImageListCount(
FileHandle As Long, ImageListID As Long) As Long
DLL
int DLDAGetImageListCount(int InstanceID, int FileHandle,
int ImageListID);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID A value returned by the DAGetPageImageList function
Copyright© 2007-2024 https://loslab.com
DAGetInformation
Document properties, Direct access functionality
Description
Retrieves information from the document information section. This could be standard information
such as Author and Subject, or custom information.
Syntax
Delphi
function TPDFlib.DAGetInformation(FileHandle: Integer;
Key: WideString): WideString;
ActiveX
Function PDFlib::DAGetInformation(
FileHandle As Long, Key As String) As String
DLL
wchar_t * DLDAGetInformation(int InstanceID, int FileHandle,
wchar_t * Key);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Key
For standard information use "Author", "Title", "Subject", "Keywords", "Creator",
or "Producer". For custom information any other string can be used.
Copyright© 2007-2024 https://loslab.com
DAGetObjectCount
Miscellaneous functions, Direct access functionality
Description
Returns the number of raw PDF objects in the document. Syntax
Delphi
function TPDFlib.DAGetObjectCount(
FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DAGetObjectCount(
FileHandle As Long) As Long
DLL
int DLDAGetObjectCount(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Copyright© 2007-2024 https://loslab.com
DAGetObjectToString
Miscellaneous functions, Direct access functionality
Description
Returns the raw PDF object data for the specified object number. This is for advanced use only.
Syntax
Delphi
function TPDFlib.DAGetObjectToString(FileHandle,
ObjectNumber: Integer): AnsiString;
DLL
char * DLDAGetObjectToString(int InstanceID, int FileHandle,
int ObjectNumber);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ObjectNumber
The number of the object to retrieve. The first object is numbered 1 and the
last object has an object number equal to the result of the GetObjectCount
function.
Copyright© 2007-2024 https://loslab.com
DAGetObjectToVariant
Miscellaneous functions, Direct access functionality
Description
Returns the raw PDF object data for the specified object number as a variant byte array.
This is for advanced use only.
Syntax
ActiveX
Function PDFlib::DAGetObjectToVariant(
FileHandle As Long, ObjectNumber As Long) As Variant
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ObjectNumber
The number of the object to retrieve. The first object is numbered 1 and the
last object has an object number equal to the result of the GetObjectCount
function.
Copyright© 2007-2024 https://loslab.com
DAGetPageBox
Direct access functionality, Page properties
Description
Returns a dimension of the specified page boundary rectangle.
Returned values are points measured from the bottom left corner of the page.
Syntax
Delphi
function TPDFlib.DAGetPageBox(FileHandle, PageRef, BoxIndex,
Dimension: Integer): Double;
ActiveX
Function PDFlib::DAGetPageBox(FileHandle As Long,
PageRef As Long, BoxIndex As Long, Dimension As Long) As Double
DLL
double DLDAGetPageBox(int InstanceID, int FileHandle, int PageRef,
int BoxIndex, int Dimension);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
BoxIndex
1 = MediaBox
2 = CropBox
3 = BleedBox
4 = TrimBox
5 = ArtBox
Dimension
0 = Left
1 = Top
2 = Width
3 = Height
4 = Right
5 = Bottom
Copyright© 2007-2024 https://loslab.com
DAGetPageContentToString
Direct access functionality, Page properties
Description
Retrieves the graphics commands and operators that make up the specified page.
Syntax
Delphi
function TPDFlib.DAGetPageContentToString(FileHandle,
PageRef: Integer): AnsiString;
DLL
char * DLDAGetPageContentToString(int InstanceID, int FileHandle,
int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Copyright© 2007-2024 https://loslab.com
DAGetPageContentToVariant
Direct access functionality, Page properties
Description
Retrieves the graphics commands and operators that make up the specified page as a variant byte
array.
Syntax
ActiveX
Function PDFlib::DAGetPageContentToVariant(
FileHandle As Long, PageRef As Long) As Variant
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Copyright© 2007-2024 https://loslab.com
DAGetPageCount
Document properties, Direct access functionality
Description
Returns the number of pages in a document opened with the DAOpenFile function.
Syntax
Delphi
function TPDFlib.DAGetPageCount(
FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DAGetPageCount(
FileHandle As Long) As Long
DLL
int DLDAGetPageCount(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Return values
0
The specified FileHandle was not valid
Non-zero
The number of pages in the document
Copyright© 2007-2024 https://loslab.com
DAGetPageHeight
Direct access functionality, Page properties
Description
Returns the height of the specified page in a document opened with the DAOpenFile function.
Syntax
Delphi
function TPDFlib.DAGetPageHeight(FileHandle,
PageRef: Integer): Double;
ActiveX
Function PDFlib::DAGetPageHeight(
FileHandle As Long, PageRef As Long) As Double
DLL
double DLDAGetPageHeight(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Copyright© 2007-2024 https://loslab.com
DAGetPageImageList
Image handling, Direct access functionality, Page properties
Description
This function finds all the images on the selected page and returns an ImageListID that can be
used with the DAGetImageListCount, DAGetImageListItemIntProperty,
DAGetImageListItemDblProperty, DAGetImageListItemDataToString,
DAGetImageListItemDataToVariant and DASaveImageListItemDataToFile functions.
It will include Inline images but the ImageID will be 0 for any inline image which means that any
inline images cannot used with ReplaceImage or ClearImage functions.
Syntax
Delphi
function TPDFlib.DAGetPageImageList(FileHandle,
PageRef: Integer): Integer;
ActiveX
Function PDFlib::DAGetPageImageList(
FileHandle As Long, PageRef As Long) As Long
DLL
int DLDAGetPageImageList(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage function
Return values
0
The FileHandle or PageRef parameters were invalid
Non-zero
An ImageListID value that can be used with the other direct access image list
functions
Copyright© 2007-2024 https://loslab.com
DAGetPageWidth
Direct access functionality, Page properties
Description
Returns the width of the specified page in a document opened with the DAOpenFile function.
Syntax
Delphi
function TPDFlib.DAGetPageWidth(FileHandle,
PageRef: Integer): Double;
ActiveX
Function PDFlib::DAGetPageWidth(
FileHandle As Long, PageRef As Long) As Double
DLL
double DLDAGetPageWidth(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockAsString
Text, Extraction, Direct access functionality
Description
Returns all the text block entries for a single text block as a formatted string delimited by CR/LF
Syntax
Delphi
function TPDFlib.DAGetTextBlockAsString(TextBlockListID,
Index: Integer): WideString;
ActiveX
Function PDFlib::DAGetTextBlockAsString(
TextBlockListID As Long, Index As Long) As String
DLL
wchar_t * DLDAGetTextBlockAsString(int InstanceID, int TextBlockListID,
int Index);
Parameters
TextBlockListID A value returned by the ExtractPageTextBlocks function
Index
The index of the text block. The first text block in the list has an index of 1.
Return values
TextBlockAsString
A formatted string of all available text block fields where each line is
separate by a CR/LF. Here is a sample output string
CNT:4
FNT:Arial
SIZ:12
CLR:#000000
TX1:20
TY1:769.516
TX2:48.02
TY2:769.516
TX3:48.02
TY3:780.616
TX4:20
TY4:780.616
WID:8.004,6.672,6.672,6.672
TXT:Page
where CNT = char count, FNT = fontname, SIZ = Fontsize, CLR = color,
TXx = X value for bounds point x, TYy = Y value for bounds y, WID =
comma separated character widths, TXT = extracted text.
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockBound
Text, Extraction, Direct access functionality
Description
Returns one of the bounds of the specified text block.
Syntax
Delphi
function TPDFlib.DAGetTextBlockBound(TextBlockListID, Index,
BoundIndex: Integer): Double;
ActiveX
Function PDFlib::DAGetTextBlockBound(
TextBlockListID As Long, Index As Long,
BoundIndex As Long) As Double
DLL
double DLDAGetTextBlockBound(int InstanceID, int TextBlockListID,
int Index, int BoundIndex);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
BoundIndex
1 = Bottom left horizontal coordinate
2 = Bottom left vertical coordinate
3 = Bottom right horizontal coordinate
4 = Bottom right vertical coordinate
5 = Top right horizontal coordinate
6 = Top right vertical coordinate
7 = Top left horizontal coordinate
8 = Top left vertical coordinate
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockCharWidth
Text, Fonts, Extraction, Direct access functionality
Description
Returns the width of a particular character within the specified text block.
Syntax
Delphi
function TPDFlib.DAGetTextBlockCharWidth(TextBlockListID,
Index, CharIndex: Integer): Double;
ActiveX
Function PDFlib::DAGetTextBlockCharWidth(
TextBlockListID As Long, Index As Long,
CharIndex As Long) As Double
DLL
double DLDAGetTextBlockCharWidth(int InstanceID, int TextBlockListID,
int Index, int CharIndex);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
CharIndex
The index of the character to retrieve the width of. The first character has
an index of 1.
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockColor
Text, Extraction, Color, Direct access functionality
Description
Returns one component of the color of the text in the specified text block.
The color component value is returned as a value between 0 and 1.
Syntax
Delphi
function TPDFlib.DAGetTextBlockColor(TextBlockListID, Index,
ColorComponent: Integer): Double;
ActiveX
Function PDFlib::DAGetTextBlockColor(
TextBlockListID As Long, Index As Long,
ColorComponent As Long) As Double
DLL
double DLDAGetTextBlockColor(int InstanceID, int TextBlockListID,
int Index, int ColorComponent);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
ColorComponent
For RGB:
1 = Red
2 = Green
3 = Blue
For CMYK:
1 = Cyan
2 = Magenta
3 = Yellow
4 = Black
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockColorType
Text, Extraction, Color, Direct access functionality
Description
Returns the type of color of the text in the specified text block.
Syntax
Delphi
function TPDFlib.DAGetTextBlockColorType(TextBlockListID,
Index: Integer): Integer;
ActiveX
Function PDFlib::DAGetTextBlockColorType(
TextBlockListID As Long, Index As Long) As Long
DLL
int DLDAGetTextBlockColorType(int InstanceID, int TextBlockListID,
int Index);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
Return values
3
RGB
4
CMYK
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockCount
Text, Extraction, Direct access functionality
Description
Returns the number of text blocks in the specified text block list.
Syntax
Delphi
function TPDFlib.DAGetTextBlockCount(
TextBlockListID: Integer): Integer;
ActiveX
Function PDFlib::DAGetTextBlockCount(
TextBlockListID As Long) As Long
DLL
int DLDAGetTextBlockCount(int InstanceID, int TextBlockListID);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockFontName
Text, Fonts, Extraction, Direct access functionality
Description
Returns the font name of the text in the specified text block.
Syntax
Delphi
function TPDFlib.DAGetTextBlockFontName(TextBlockListID,
Index: Integer): WideString;
ActiveX
Function PDFlib::DAGetTextBlockFontName(
TextBlockListID As Long, Index As Long) As String
DLL
wchar_t * DLDAGetTextBlockFontName(int InstanceID, int TextBlockListID,
int Index);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockFontSize
Text, Fonts, Extraction, Direct access functionality
Description
Returns the font size of the text in the specified text block.
Syntax
Delphi
function TPDFlib.DAGetTextBlockFontSize(TextBlockListID,
Index: Integer): Double;
ActiveX
Function PDFlib::DAGetTextBlockFontSize(
TextBlockListID As Long, Index As Long) As Double
DLL
double DLDAGetTextBlockFontSize(int InstanceID, int TextBlockListID,
int Index);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
Copyright© 2007-2024 https://loslab.com
DAGetTextBlockText
Text, Extraction, Direct access functionality
Description
Returns the text in the specified text block.
Syntax
Delphi
function TPDFlib.DAGetTextBlockText(TextBlockListID,
Index: Integer): WideString;
ActiveX
Function PDFlib::DAGetTextBlockText(
TextBlockListID As Long, Index As Long) As String
DLL
wchar_t * DLDAGetTextBlockText(int InstanceID, int TextBlockListID,
int Index);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Index
The index of the text block. The first text block in the list has an index of 1.
Copyright© 2007-2024 https://loslab.com
DAHasPageBox
Direct access functionality, Page properties
Description
Determines if a page has a particular page boundary rectangle.
Syntax
Delphi
function TPDFlib.DAHasPageBox(FileHandle, PageRef,
BoxIndex: Integer): Integer;
ActiveX
Function PDFlib::DAHasPageBox(FileHandle As Long,
PageRef As Long, BoxIndex As Long) As Long
DLL
int DLDAHasPageBox(int InstanceID, int FileHandle, int PageRef,
int BoxIndex);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef
A page reference returned by the DAFindPage or DANewPage functions
BoxIndex
1 = MediaBox
2 = CropBox
3 = BleedBox
4 = TrimBox
5 = ArtBox
Return values
0
The page does not have the specified page boundary rectangle
1
The page has the specified page boundary rectangle
Copyright© 2007-2024 https://loslab.com
DAHidePage
Direct access functionality, Page manipulation
Description
Hides the specified page from a document originally opened with DAOpenFile. The content of the
page is still in the document, but the page will not be visible.
Syntax
Delphi
function TPDFlib.DAHidePage(FileHandle,
PageRef: Integer): Integer;
ActiveX
Function PDFlib::DAHidePage(FileHandle As Long,
PageRef As Long) As Long
DLL
int DLDAHidePage(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Return values
0
The specified FileHandle or PageRef were not valid
1
The page was hidden successfully
Copyright© 2007-2024 https://loslab.com
DAMovePage
Direct access functionality, Page manipulation
Description
Moves a page to a new location in the document.
Syntax
Delphi
function TPDFlib.DAMovePage(FileHandle, PageRef,
TargetPageRef, Options: Integer): Integer;
ActiveX
Function PDFlib::DAMovePage(FileHandle As Long,
PageRef As Long, TargetPageRef As Long,
Options As Long) As Long
DLL
int DLDAMovePage(int InstanceID, int FileHandle, int PageRef,
int TargetPageRef, int Options);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions.
This is the page that will be moved.
TargetPageRef A page reference returned by the DAFindPage or DANewPage functions.
The page will be moved before or after this page.
Options
0 = Move before target page
1 = Move after target page
Return values
0
The page could not be moved. Check that the FileHandle, PageRef and
TargetPageRef values are correct.
1
The page was moved successfully
Copyright© 2007-2024 https://loslab.com
DANewPage
Direct access functionality, Page manipulation
Description
Adds a new blank page to the end of the document. The page will have a standard size of 612x792
points.
Syntax
Delphi
function TPDFlib.DANewPage(FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DANewPage(
FileHandle As Long) As Long
DLL
int DLDANewPage(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Return values
0
The specified FileHandle was not valid
Non-zero
An ID that can be used as the PageRef parameter for any of the direct access
functions
Copyright© 2007-2024 https://loslab.com
DANewPages
Direct access functionality, Page manipulation
Description
Adds a number of new pages to the end of the document. All new pages have a standard size of
612x792 points.
Syntax
Delphi
function TPDFlib.DANewPages(FileHandle,
PageCount: Integer): Integer;
ActiveX
Function PDFlib::DANewPages(FileHandle As Long,
PageCount As Long) As Long
DLL
int DLDANewPages(int InstanceID, int FileHandle, int PageCount);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageCount
The number of pages to add to the document
Return values
0
The specified FileHandle was not valid
Non-zero
The total number of pages in the document after the new pages were added
Copyright© 2007-2024 https://loslab.com
DANormalizePage
Text, Document manipulation, Direct access functionality, Page manipulation
Description
Moves and/or rotates the contents of the page so that subsequent drawing operations are at the
expected position on the page. All the page boundary boxes are adjusted to the physical size of the
page and the page's rotation attribute is reset to zero.
Syntax
Delphi
function TPDFlib.DANormalizePage(FileHandle, PageRef,
NormalizeOptions: Integer): Integer;
ActiveX
Function PDFlib::DANormalizePage(
FileHandle As Long, PageRef As Long,
NormalizeOptions As Long) As Long
DLL
int DLDANormalizePage(int InstanceID, int FileHandle, int PageRef,
int NormalizeOptions);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
NormalizeOptions
0 = Standard normalization
Copyright© 2007-2024 https://loslab.com
DAOpenFile
Document management, Direct access functionality
Description
Opens a file in direct access mode. This allows large files to be processed. The file will not be
accessible by other processes until the file is closed using the one of the following functions:
DACloseFile, DAAppendFile or DASaveAsFile. Read only files can be opened and all other direct
access functions will work but DAAppendFile will not work as the file cannot be written.
Syntax
Delphi
function TPDFlib.DAOpenFile(InputFileName,
Password: WideString): Integer;
ActiveX
Function PDFlib::DAOpenFile(
InputFileName As String, Password As String) As Long
DLL
int DLDAOpenFile(int InstanceID, wchar_t * InputFileName,
wchar_t * Password);
Parameters
InputFileName
The path and name of the document to open in direct access mode.
Password
The password to use when opening the document. This can be the owner or
user password. If the user password is used certain functionality may be
restricted depending on the permissions of the document.
Return values
0 The file could not be opened. Use the LastErrorCode function to determine
the cause of the failure.
Non-zero
A FileHandle that can be used with the other Direct Access functions
Copyright© 2007-2024 https://loslab.com
DAOpenFileReadOnly
Document management, Direct access functionality
Description
Opens a file in direct access mode. This allows large files to be processed. The file is opened with
read only access so other processes will also be able to open the file in read only mode.
DASaveAsFile should be used to save any changes to a new file as DAAppendFile cannot update
read only files.
Syntax
Delphi
function TPDFlib.DAOpenFileReadOnly(InputFileName,
Password: WideString): Integer;
ActiveX
Function PDFlib::DAOpenFileReadOnly(
InputFileName As String, Password As String) As Long
DLL
int DLDAOpenFileReadOnly(int InstanceID, wchar_t * InputFileName,
wchar_t * Password);
Parameters
InputFileName
The path and name of the document to open in direct access mode with read
only access.
Password
The password to use when opening the document. This can be the owner or
user password. If the user password is used certain functionality may be
restricted depending on the permissions of the document.
Return values
0 The file could not be opened. Use the LastErrorCode function to determine
the cause of the failure.
Non-zero
A FileHandle that can be used with the other Direct Access functions
Copyright© 2007-2024 https://loslab.com
DAOpenFromStream
Document management, Direct access functionality
Description
Opens a PDF stored inside a Delphi TStream object in direct access mode. Syntax
Delphi
function TPDFlib.DAOpenFromStream(InStream: TStream;
Password: WideString): Integer;
Parameters
InStream
The TStream object containing the PDF document data
Password
The password to use when opening the document. This can be the owner or user
password. If the user password is used certain functionality may be restricted
depending on the permissions of the document.
Return values
0
The file could not be opened from the stream
Non-zero
A FileHandle that can be used with the other Direct Access functions
Copyright© 2007-2024 https://loslab.com
DAPageRotation
Direct access functionality, Page properties
Description
Returns the rotation of the specified page.
Syntax
Delphi
function TPDFlib.DAPageRotation(FileHandle,
PageRef: Integer): Integer;
ActiveX
Function PDFlib::DAPageRotation(
FileHandle As Long, PageRef As Long) As Long
DLL
int DLDAPageRotation(int InstanceID, int FileHandle, int PageRef);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Copyright© 2007-2024 https://loslab.com
DAReleaseImageList
Image handling, Direct access functionality, Page properties
Description
Releases the specified image list including all the image data extracted from the images in the list.
Releasing the image list does not affect the original images.
Syntax
Delphi
function TPDFlib.DAReleaseImageList(FileHandle,
ImageListID: Integer): Integer;
ActiveX
Function PDFlib::DAReleaseImageList(
FileHandle As Long, ImageListID As Long) As Long
DLL
int DLDAReleaseImageList(int InstanceID, int FileHandle, int ImageListID);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID A value returned by the DAGetPageImageList function
Return values
0
The image list could not be released. The ImageListID parameter might be
invalid or does not refer to an image list within the specified document.
1
The image list was released successfully.
Copyright© 2007-2024 https://loslab.com
DAReleaseTextBlocks
Direct access functionality
Description
Releases the memory used by a text block list.
Syntax
Delphi
function TPDFlib.DAReleaseTextBlocks(
TextBlockListID: Integer): Integer;
ActiveX
Function PDFlib::DAReleaseTextBlocks(
TextBlockListID As Long) As Long
DLL
int DLDAReleaseTextBlocks(int InstanceID, int TextBlockListID);
Parameters
TextBlockListID A value returned by the DAExtractPageTextBlocks or
ExtractFilePageTextBlocks functions
Copyright© 2007-2024 https://loslab.com
DARemoveUsageRights
Document manipulation, Direct access functionality
Description
Removes any usage rights from the document.
Syntax
Delphi
function TPDFlib.DARemoveUsageRights(
FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DARemoveUsageRights(
FileHandle As Long) As Long
DLL
int DLDARemoveUsageRights(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Return values
0
The document did not have any usage rights
1
Success
Copyright© 2007-2024 https://loslab.com
DARenderPageToDC
Direct access functionality, Rendering and printing
Description
Renders the specified page from the specified document directly onto a graphics surface.
On Windows the target surface is a Device Context handle (DC).
By default rendering uses the GDI+ system which is available
in Windows XP and later.
It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer
functions.
Syntax
Delphi
function TPDFlib.DARenderPageToDC(FileHandle,
PageRef: Integer; DPI: Double; DC: HDC): Integer;
ActiveX
Function PDFlib::DARenderPageToDC(
FileHandle As Long, PageRef As Long, DPI As Double,
DC As Long) As Long
DLL
int DLDARenderPageToDC(int InstanceID, int FileHandle, int PageRef,
double DPI, HDC DC);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
DPI
The DPI to use when rendering the page
DC
The device context handle
Return values
0
The page could not be rendered
1
The page was rendered successfully
Copyright© 2007-2024 https://loslab.com
DARenderPageToFile
Direct access functionality, Rendering and printing
Description
Renders the specified page from the specified document to an image and saves the image data as
a file on disk.
By default rendering uses the GDI+ system which is available
in Windows XP and later.
Option 10, TIFF (G4) output, is only available on Windows Vista and Windows Server 2008 and
later.
It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer
functions.
Syntax
Delphi
function TPDFlib.DARenderPageToFile(FileHandle, PageRef,
Options: Integer; DPI: Double; FileName: WideString): Integer;
ActiveX
Function PDFlib::DARenderPageToFile(
FileHandle As Long, PageRef As Long, Options As Long,
DPI As Double, FileName As String) As Long
DLL
int DLDARenderPageToFile(int InstanceID, int FileHandle, int PageRef,
int Options, double DPI, wchar_t * FileName);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Options
0 = BMP output
1 = JPEG output
2 = WMF output
3 = EMF output
4 = EPS output
5 = PNG output
6 = GIF output
7 = TIFF output
8 = EMF+ output
9 = HTML5 output
10 = G4 TIFF output
DPI
The DPI to use when rendering the page. Values over 300 will cause excessive
memory usage.
FileName
The path and file name of the file to create to store the rendered page image data
in.
Return values
0
The page could not be rendered. Check the value of the FileHandle and PageRef
parameters.
1
The page was rendered correctly and the image file was saved to disk
2
The file could not be written to disk
Copyright© 2007-2024 https://loslab.com
DARenderPageToStream
Direct access functionality, Rendering and printing
Description
This function is only available in the Delphi edition.
It renders the specified page from the specified document to an image and returns the image data
in the supplied TStream.
By default rendering uses the GDI+ system which is available in Windows XP and later.
Option 10, TIFF (G4) output, is only available on Windows Vista and Windows Server 2008 and
later.
It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer
functions.
Syntax
Delphi
function TPDFlib.DARenderPageToStream(FileHandle, PageRef,
Options: Integer; DPI: Double; Target: TStream): Integer;
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Options
0 = BMP output
1 = JPEG output
2 = WMF output
3 = EMF output
4 = EPS output
5 = PNG output
6 = GIF output
7 = TIFF output
8 = EMF+ output
9 = HTML5 output
10 = G4 TIFF output
DPI
The DPI to use when rendering the page. Values over 300 will cause excessive
memory usage.
Target
The stream to place the rendered page into
Return values
0
The page could not be rendered. Check that the FileHandle and PageRef
parameters contain valid values.
1
The page was rendered and the image data was put into the stream
Copyright© 2007-2024 https://loslab.com
DARenderPageToString
Direct access functionality, Rendering and printing
Description
It renders the specified page from the specified document to an image and returns the image data
as a string.
By default rendering uses the GDI+ system which is available in Windows XP and later.
Option 10, TIFF (G4) output, is only available on Windows Vista and Windows Server 2008 and
later.
It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer
functions.
Syntax
Delphi
function TPDFlib.DARenderPageToString(FileHandle, PageRef,
Options: Integer; DPI: Double): AnsiString;
DLL
char * DLDARenderPageToString(int InstanceID, int FileHandle,
int PageRef, int Options, double DPI);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Options
0 = BMP output
1 = JPEG output
2 = WMF output
3 = EMF output
4 = EPS output
5 = PNG output
6 = GIF output
7 = TIFF output
8 = EMF+ output
9 = HTML5 output
10 = G4 TIFF output
DPI
The DPI to use when rendering the page. Values over 300 will cause excessive
memory usage.
Copyright© 2007-2024 https://loslab.com
DARenderPageToVariant
Direct access functionality, Rendering and printing
Description
Renders the specified page from the specified document to an image and returns the image data as
a byte array variant.
By default rendering uses the GDI+ system which is available in Windows XP and later.
Option 10, TIFF (G4) output, is only available on Windows Vista and Windows Server 2008 and
later.
It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer
functions.
Syntax
ActiveX
Function PDFlib::DARenderPageToVariant(
FileHandle As Long, PageRef As Long, Options As Long,
DPI As Double) As Variant
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Options
0 = BMP output
1 = JPEG output
2 = WMF output
3 = EMF output
4 = EPS output
5 = PNG output
6 = GIF output
7 = TIFF output
8 = EMF+ output
9 = HTML5 output
10 = G4 TIFF output
DPI
The DPI to use when rendering the page. Values over 300 will cause excessive
memory usage.
Copyright© 2007-2024 https://loslab.com
DARotatePage
Direct access functionality, Page properties
Description
Sets the rotation of the selected page. The rotation is only applicable to the viewed page, the
co-ordinate system rotates with the page.
Syntax
Delphi
function TPDFlib.DARotatePage(FileHandle, PageRef, Angle,
Options: Integer): Integer;
ActiveX
Function PDFlib::DARotatePage(FileHandle As Long,
PageRef As Long, Angle As Long, Options As Long) As Long
DLL
int DLDARotatePage(int InstanceID, int FileHandle, int PageRef,
int Angle, int Options);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
Angle
The clockwise angle in degrees to rotate the page by, must be a multiple of 90
Options
Reserved for future use. Must be set to 0.
Return values
0
The page rotation could not be set. Check that the FileHandle and PageRef
parameters are correct, and ensure that the Angle parameter is a multiple of 90.
1
The page rotation was set successfully
Copyright© 2007-2024 https://loslab.com
DASaveAsFile
Document management, Direct access functionality
Description
Rewrites the entire file, including all changes, to a new file. This operation may take some time
with large files or files with many objects. The original file is closed after this operation and the file
handle will no longer be valid. The original file cannot be overwritten. Use DAAppendFile if you
want to append changes to original file.
Syntax
Delphi
function TPDFlib.DASaveAsFile(FileHandle: Integer;
OutputFileName: WideString): Integer;
ActiveX
Function PDFlib::DASaveAsFile(FileHandle As Long,
OutputFileName As String) As Long
DLL
int DLDASaveAsFile(int InstanceID, int FileHandle,
wchar_t * OutputFileName);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
OutputFileName
The path and name of the new document to create.
Return values
0
The new file could not be created
1
The document was saved to the new file successfully
Copyright© 2007-2024 https://loslab.com
DASaveCopyToStream
Document management, Direct access functionality
Description
Similar to DASaveToStream but the input file is not closed.
Syntax
Delphi
function TPDFlib.DASaveCopyToStream(FileHandle: Integer;
OutStream: TStream): Integer;
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
OutStream
The Delphi TStream object to save the file into
Return values
0
The file could not be saved to the stream
1
The file was successfully saved to the stream
Copyright© 2007-2024 https://loslab.com
DASaveImageDataToFile
Image handling, Direct access functionality
Description
Saves an image in an image list to a file on disk. The type of image file depends on the type of the
image. The DAGetImageIntProperty function can be used to determine the image type.
Syntax
Delphi
function TPDFlib.DASaveImageDataToFile(FileHandle,
ImageListID, ImageIndex: Integer; ImageFileName: WideString): Integer;
ActiveX
Function PDFlib::DASaveImageDataToFile(
FileHandle As Long, ImageListID As Long, ImageIndex As Long,
ImageFileName As String) As Long
DLL
int DLDASaveImageDataToFile(int InstanceID, int FileHandle,
int ImageListID, int ImageIndex, wchar_t * ImageFileName);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
ImageListID A value returned by the DAGetPageImageList function
ImageIndex
The index of the image. The first image in the list has an index of 1. Use the
DAGetImageListCount function to determine the number of images in the
list.
ImageFileName
The path and file name of the file to create to store the image data in.
Copyright© 2007-2024 https://loslab.com
DASaveToStream
Document management, Direct access functionality
Description
Saves the file to a TStream.
Syntax
Delphi
function TPDFlib.DASaveToStream(FileHandle: Integer;
OutStream: TStream): Integer;
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
OutStream
The Delphi TStream object to save the file into
Return values
0
The file could not be saved to the stream
1
The file was successfully saved to the stream
Copyright© 2007-2024 https://loslab.com
DASetInformation
Document properties, Direct access functionality
Description
Sets values in the document information section.
This could be standard information such as Author and Subject, or custom information.
For CreationDate and ModDate (modification date), the format of the date should be:
D:YYYYMMDDHHmmSSOHH'mm'
where
YYYY shall be the year
MM shall be the month (01-12)
DD shall be the day (01-31)
HH shall be the hour (00-23)
mm shall be the minute (00-59)
SS shall be the second (00-59)
O shall be the relationship of local time to Universal Time (UT) using a +, - or Z character
HH followed by APOSTROPHE (U+0027) (') shall be the absolute value of the offset from UT in
hours (00-23)
mm followed by an optional APOSTROPHE (U+0027) (') shall be the absolute value of the offset
from UT in minutes (00-59)
Syntax
Delphi
function TPDFlib.DASetInformation(FileHandle: Integer; Key,
NewValue: WideString): Integer;
ActiveX
Function PDFlib::DASetInformation(
FileHandle As Long, Key As String, NewValue As String) As Long
DLL
int DLDASetInformation(int InstanceID, int FileHandle, wchar_t * Key,
wchar_t * NewValue);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Key
For standard information use "Author", "Title", "Subject", "Keywords", "Creator",
"Producer", "CreationDate" or "ModDate". For custom information any other string
can be used.
NewValue
The new value for the specified key.
Return values
0
The specified FileHandle was not valid
1
The information key was set or updated successfully
Copyright© 2007-2024 https://loslab.com
DASetPageBox
Direct access functionality, Page properties
Description
Sets the dimensions of the specified page's boundary rectangles.
The MediaBox represents the physical medium of the page.
The CropBox represents the visible region of the page, the contents will be clipped to this region.
The BleedBox is similar to the CropBox, but is the rectangle used in a production environment.
The TrimBox indicates the intended dimensions of the finished page after trimming, and the ArtBox
defines the extent of the page's meaningful content as intended by the page's creator.
Syntax
Delphi
function TPDFlib.DASetPageBox(FileHandle, PageRef,
BoxIndex: Integer; X1, Y1, X2, Y2: Double): Integer;
ActiveX
Function PDFlib::DASetPageBox(FileHandle As Long,
PageRef As Long, BoxIndex As Long, X1 As Double, Y1 As Double,
X2 As Double, Y2 As Double) As Long
DLL
int DLDASetPageBox(int InstanceID, int FileHandle, int PageRef,
int BoxIndex, double X1, double Y1, double X2, double Y2);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef
A page reference returned by the DAFindPage or DANewPage functions
BoxIndex
1 = MediaBox
2 = CropBox
3 = BleedBox
4 = TrimBox
5 = ArtBox
X1
The horizontal coordinate of the bottom left corner of the box measured in points
from the left edge of the page
Y1
The vertical coordinate of the bottom left corner of the box measured in points
from the bottom of the page
X2
The horizontal coordinate of the top right corner of the box measured in points
from the bottom of the page
Y2
The vertical coordinate of the top right corner of the box measured in points from
the bottom of the page
Return values
0
The FileHandle or PageRef parameters were invalid
1
Success
Copyright© 2007-2024 https://loslab.com
DASetPageLayout
Document properties, Direct access functionality
Description
Sets the initial page layout of the document using the direct Access Functionality.
Syntax
Delphi
function TPDFlib.DASetPageLayout(FileHandle,
NewPageLayout: Integer): Integer;
ActiveX
Function PDFlib::DASetPageLayout(
FileHandle As Long, NewPageLayout As Long) As Long
DLL
int DLDASetPageLayout(int InstanceID, int FileHandle, int NewPageLayout);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
NewPageLayout
0 = Single page
1 = One column
2 = Two columns, odd-numbered pages on left
3 = Two columns, odd-numbered pages on right
4 = Two pages, odd-numbered pages on left
5 = Two pages, odd-numbered pages on right
6 = No preference (setting removed from document)
Return values
0
The page layout could not be set
1
The page layout was set successfully
Copyright© 2007-2024 https://loslab.com
DASetPageMode
Document properties, Direct access functionality
Description
Sets the initial page mode of the document using the Direct Access functionality.
Syntax
Delphi
function TPDFlib.DASetPageMode(FileHandle,
NewPageMode: Integer): Integer;
ActiveX
Function PDFlib::DASetPageMode(
FileHandle As Long, NewPageMode As Long) As Long
DLL
int DLDASetPageMode(int InstanceID, int FileHandle, int NewPageMode);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
NewPageMode
0 = Normal view
1 = Show the outlines pane
2 = Show the thumbnails pane
3 = Show the document in full screen mode
4 = Optional content group panel visible
5 = Attachments panel visible
Return values
0
The page mode could not be set
1
The page mode was set successfully
Copyright© 2007-2024 https://loslab.com
DASetPageSize
Direct access functionality, Page properties
Description
Sets the specified page to have a certain width and height.
Syntax
Delphi
function TPDFlib.DASetPageSize(FileHandle, PageRef: Integer;
PntWidth, PntHeight: Double): Integer;
ActiveX
Function PDFlib::DASetPageSize(
FileHandle As Long, PageRef As Long, PntWidth As Double,
PntHeight As Double) As Long
DLL
int DLDASetPageSize(int InstanceID, int FileHandle, int PageRef,
double PntWidth, double PntHeight);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
PageRef
A page reference returned by the DAFindPage or DANewPage functions
PntWidth
The new width of the page, measured in points
PntHeight
The new height of the page, measured in points
Return values
0
The specified FileHandle or PageRef were not valid
1
The page size was set successfully
Copyright© 2007-2024 https://loslab.com
DASetTextExtractionArea
Text, Extraction, Direct access functionality
Description
Sets the area for certain modes of text extraction. Any text that appears outside this area will be
excluded from the results. This function has no effect on text extraction using modes 0 to 2.
This function affects the results of the ExtractFilePageText and DAExtractPageText functions
only.
The coordinate values passed into this function are specified in points with the bottom left corner of
the page as the origin.
The area limitation can be removed by calling this function with a value of zero for both the Width
and Height parameters.
Syntax
Delphi
function TPDFlib.DASetTextExtractionArea(Left, Top, Width,
Height: Double): Integer;
ActiveX
Function PDFlib::DASetTextExtractionArea(
Left As Double, Top As Double, Width As Double,
Height As Double) As Long
DLL
int DLDASetTextExtractionArea(int InstanceID, double Left, double Top,
double Width, double Height);
Parameters
Left
The horizontal coordinate of the left edge of the area
Top
The vertical coordinate of the top edge of the area
Width
The width of the area
Height
The height of the area
Return values
1
The text extraction area was set successfully
2
The text extraction area was cleared
Copyright© 2007-2024 https://loslab.com
DASetTextExtractionOptions
Text, Extraction, Direct access functionality
Description
Sets various options that affect the text extraction functionality.
This function affects the results of the ExtractFilePageText and DAExtractPageText functions only.
Syntax
Delphi
function TPDFlib.DASetTextExtractionOptions(OptionID,
NewValue: Integer): Integer;
ActiveX
Function PDFlib::DASetTextExtractionOptions(
OptionID As Long, NewValue As Long) As Long
DLL
int DLDASetTextExtractionOptions(int InstanceID, int OptionID,
int NewValue);
Parameters
OptionID
1 = Ignore Font changes to allow grouping different blocks together
2 = Ignore Color changes to allow grouping different blocks together
3 = Ignore Text Block changes to allow grouping different blocks together
4 = Output CMYK color values
5 = Sort text blocks based on top left position
6 = Descenders from font metrics
7 = Ignore overlaps
8 = Ignore duplicates
9 = Split on double space
10 = Trim characters outside area
11 = Alternative block matching
12 = Ignore rotated text blocks
13 = Trim leading and trailing whitespace from text blocks
14 = Output non ASCII characters below Space character (0x32)
15 = Remove certain character strings such as underscore lines (see below)
NewValue
For OptionID = 1, 2, 3 and 6:
0 = Use, 1 = Ignore
For OptionID = 4:
0 = Show as RGB (default), 1 = Show as CMYK
For OptionID = 5:
0 = Do not sort blocks (default), 1 = Sort blocks
For OptionID = 7, 8 and 12:
0 = Do not ignore, 1 = Ignore
OptionID = 9:
0 = Do not split on double space (default)
1 = Split on double space
OptionID = 10:
0 = Do not trim characters outside area (default)
1 = Trim characters outside area
OptionID = 11:
0 = Regular block matching
1 = Alternative block matching
OptionID = 13:
0 = Do not trim leading or trailing whitespace
1 = Trim leading and trailing whitespace
OptionID = 14
0 = Remove non ASCII chracters below space character from output (default)
1 = Output raw unfiltered ASCII characters
OptionID = 15
0 = Output text lines made with Underscore characters (default)
1 = Remove text lines made with Underscore characters
Return values
0
The OptionID or NewValue parameter was not valid
1
The text extraction option was set successfully
Copyright© 2007-2024 https://loslab.com
DASetTextExtractionScaling
Text, Extraction, Direct access functionality
Description
Sets the scaling to use for text extraction in Mode 7.
This controls the number of rows and columns in the monospaced text output.
This function affects the results of the ExtractFilePageText and DAExtractPageText functions
only.
Syntax
Delphi
function TPDFlib.DASetTextExtractionScaling(
Options: Integer; Horizontal, Vertical: Double): Integer;
ActiveX
Function PDFlib::DASetTextExtractionScaling(
Options As Long, Horizontal As Double,
Vertical As Double) As Long
DLL
int DLDASetTextExtractionScaling(int InstanceID, int Options,
double Horizontal, double Vertical);
Parameters
Options
Should always be set to 0. This indicates a scaling factor will be set for the
Horizontal and Vertical parameters, with a default value of 5 for horizontal and 8
for vertical. Smaller values stretch the text out into more rows/columns.
Horizontal
The scaling to use for the horizontal axis in units defined by the Options
parameter.
Vertical
The scaling to use for the vertical axis in units defined by the Options parameter.
Return values
0
The Options parameter was not valid or a value less than 1 was used for the
Horizontal or Vertical parameters.
1
Text extraction scaling was set successfully.
Copyright© 2007-2024 https://loslab.com
DASetTextExtractionWordGap
Text, Extraction, Direct access functionality
Description
Sets the word gap ratio for the text extraction functionality.
This function affects the results of the ExtractFilePageText and DAExtractPageText functions
only.
Syntax
Delphi
function TPDFlib.DASetTextExtractionWordGap(
NewWordGap: Double): Integer;
ActiveX
Function PDFlib::DASetTextExtractionWordGap(
NewWordGap As Double) As Long
DLL
int DLDASetTextExtractionWordGap(int InstanceID, double NewWordGap);
Parameters
NewWordGap
The new WordGap ratio
Return values
1
The word gap ratio was set successfully.
Copyright© 2007-2024 https://loslab.com
DAShiftedHeader
Document management, Direct access functionality
Description
Returns a value to determine if the source PDF was malformed due to byte shifting. For example,
leading whitespace added to the file.
In such a case the file will be loaded taking this offset into account. This function will return a
non-zero number indicating the number of bytes the file was shifted by.
Note that if the file is loaded this way it will not be possible to use the DAAppendFile function to
add an incremental update.
Syntax
Delphi
function TPDFlib.DAShiftedHeader(
FileHandle: Integer): Integer;
ActiveX
Function PDFlib::DAShiftedHeader(
FileHandle As Long) As Long
DLL
int DLDAShiftedHeader(int InstanceID, int FileHandle);
Parameters
FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or
DAOpenFromStream functions
Return values
0
The file was loaded as usual
Non-zero
The number of bytes the file was shifted by
Copyright© 2007-2024 https://loslab.com
Decrypt
Document properties, Security and Signatures
Description
This function attempts to remove the encryption setting from the selected document using the
password provided when originally opening the document.
This function will succeed even if the user password was used (including an valid blank password)
rather than the master password. Developers are advised that they should respect the security
wishes of the document's author.
Syntax
Delphi
function TPDFlib.Decrypt: Integer;
ActiveX
Function PDFlib::Decrypt As Long
DLL
int DLDecrypt(int InstanceID);
Return values
0
The document could not be decrypted
1
The document was decrypted successfully
Copyright© 2007-2024 https://loslab.com
DecryptFile
Document management, Security and Signatures
Description
This function attempts to remove the encryption from a file on disk, saving the decrypted
document to a new file.
This function will succeed even if the user password is supplied (including an valid blank password)
rather than the master password. Developers are advised that they should respect the security
wishes of the document's author.
Syntax
Delphi
function TPDFlib.DecryptFile(InputFileName, OutputFileName,
Password: WideString): Integer;
ActiveX
Function PDFlib::DecryptFile(
InputFileName As String, OutputFileName As String,
Password As String) As Long
DLL
int DLDecryptFile(int InstanceID, wchar_t * InputFileName,
wchar_t * OutputFileName, wchar_t * Password);
Parameters
InputFileName
The name of the file to decrypt.
OutputFileName
The name of the destination file to create. If this file already exists it will be
overwritten.
Password
The password to use when decrypting the file.
Return values
0
The document could not be decrypted. Check the result of the
LastErrorCode function to determine the cause of the failure.
1
The document was decrypted successfully
Copyright© 2007-2024 https://loslab.com
DeleteAnalysis
Document properties
Description
Removes a set of analysis results from memory. Call this function after calling AnalyseFile and
GetAnalysisInfo when you no longer need the information.
Syntax
Delphi
function TPDFlib.DeleteAnalysis(
AnalysisID: Integer): Integer;
ActiveX
Function PDFlib::DeleteAnalysis(
AnalysisID As Long) As Long
DLL
int DLDeleteAnalysis(int InstanceID, int AnalysisID);
Parameters
AnalysisID The ID of the set of analysis results to delete, as returned by the AnalyseFile
function
Return values
0
The specified analysis ID was not valid
1
The set of analysis results with the specified ID was deleted successfully
Copyright© 2007-2024 https://loslab.com
DeleteAnnotation
Annotations and hotspot links
Description
Removes an annotation from the selected page.
Syntax
Delphi
function TPDFlib.DeleteAnnotation(Index: Integer): Integer;
ActiveX
Function PDFlib::DeleteAnnotation(
Index As Long) As Long
DLL
int DLDeleteAnnotation(int InstanceID, int Index);
Parameters
Index
The index of the annotation to delete. The first annotation on the page has an index
of 1. The AnnotationCount function returns the total number of annotations on the
selected page.
Return values
0
The specified annotation could not be deleted. Check the value of the Index
parameter is between 1 and the value returned by the AnnotationCount function.
1
The specified annotation was deleted from the page successfully.
Copyright© 2007-2024 https://loslab.com
DeleteContentStream
Content Streams and Optional Content Groups
Description
A page in a PDF document has one or more content stream parts that together contain all the PDF
page description commands for the page.
This function removes the specified content stream part that was selected with the
SelectContentStream function.
Syntax
Delphi
function TPDFlib.DeleteContentStream: Integer;
ActiveX
Function PDFlib::DeleteContentStream As Long
DLL
int DLDeleteContentStream(int InstanceID);
Return values
0
The content stream part could not be deleted
1
The content stream part was deleted successfully
Copyright© 2007-2024 https://loslab.com
DeleteFormField
Form fields
Description
Deletes the specified form field. If the field is deleted successfully the field index of subsequent
form fields will be decreased by 1.
Syntax
Delphi
function TPDFlib.DeleteFormField(Index: Integer): Integer;
ActiveX
Function PDFlib::DeleteFormField(
Index As Long) As Long
DLL
int DLDeleteFormField(int InstanceID, int Index);
Parameters
Index
The index of the form field to delete
Return values
0
The form field was not found
1
The form field was deleted successfully
Copyright© 2007-2024 https://loslab.com
DeleteOptionalContentGroup
Content Streams and Optional Content Groups
Description
Deletes an optional content group.
Syntax
Delphi
function TPDFlib.DeleteOptionalContentGroup(
OptionalContentGroupID: Integer): Integer;
ActiveX
Function PDFlib::DeleteOptionalContentGroup(
OptionalContentGroupID As Long) As Long
DLL
int DLDeleteOptionalContentGroup(int InstanceID,
int OptionalContentGroupID);
Parameters
OptionalContentGroupID An ID returned by the NewOptionalContentGroup,
GetOptionalContentGroupID or
GetOptionalContentConfigOrderItemID functions
Copyright© 2007-2024 https://loslab.com
DeletePageLGIDict
Page properties, Measurement and coordinate units
Description
Deletes the specified LGIDict dictionary from the selected page.
Syntax
Delphi
function TPDFlib.DeletePageLGIDict(
DictIndex: Integer): Integer;
ActiveX
Function PDFlib::DeletePageLGIDict(
DictIndex As Long) As Long
DLL
int DLDeletePageLGIDict(int InstanceID, int DictIndex);
Parameters
DictIndex
The index of the LGIDict dictionary to delete. The first dictionary has an index of 1.
Use the GetPageLGIDictCount function to determine the number of LGIDict
dictionaries attached to the selected page.
Return values
0
The dictionary could not be deleted. Check that the DictIndex parameter is in
range.
1
The specified dictionary was deleted successfully.
Copyright© 2007-2024 https://loslab.com
DeletePages
Page manipulation
Description
Removes one or more pages from the document. The document will always have at least one page.
Syntax
Delphi
function TPDFlib.DeletePages(StartPage,
PageCount: Integer): Integer;
ActiveX
Function PDFlib::DeletePages(StartPage As Long,
PageCount As Long) As Long
DLL
int DLDeletePages(int InstanceID, int StartPage, int PageCount);
Parameters
StartPage
The page number of the first page to delete
PageCount
The total number of pages to delete. The value will be automatically adjusted if
necessary so that the document is left with at least one page.
Return values
0
The PageCount parameter was 0 or there was only a single page in the
document.
Non-zero
The number of pages remaining in the original document.
Copyright© 2007-2024 https://loslab.com
DocJavaScriptAction
Document properties, JavaScript
Description
This function is used to add JavaScript to document events. This JavaScript will be executed when,
for example, the document is closed or printed.
Syntax
Delphi
function TPDFlib.DocJavaScriptAction(ActionType,
JavaScript: WideString): Integer;
ActiveX
Function PDFlib::DocJavaScriptAction(
ActionType As String, JavaScript As String) As Long
DLL
int DLDocJavaScriptAction(int InstanceID, wchar_t * ActionType,
wchar_t * JavaScript);
Parameters
ActionType
The event to attach the JavaScript to:
"WC" = Will close
"WS" = Will save
"DS" = Did save
"WP" = Will print
"DP" = Did print
JavaScript
The JavaScript to attach to the event.
Return values
0
The specified ActionType was not valid
1
The JavaScript was added successfully
Copyright© 2007-2024 https://loslab.com
DocumentCount
Document management
Description
Returns the total number of documents.
When an instance
of PDF Library is first created a blank one page document is automatically
created so the document count will be 1. Each time a new document is created or loaded the
document count will be increased.
The RemoveDocument function will only succeed if there are at least two documents loaded, so
the document count will always be at least 1.
Syntax
Delphi
function TPDFlib.DocumentCount: Integer;
ActiveX
Function PDFlib::DocumentCount As Long
DLL
int DLDocumentCount(int InstanceID);
Copyright© 2007-2024 https://loslab.com
DrawArc
Vector graphics
Description
Draw a circular arc on the selected page. The arc is drawn in a clockwise direction from StartAngle
to EndAngle.
Syntax
Delphi
function TPDFlib.DrawArc(XPos, YPos, Radius, StartAngle,
EndAngle: Double; Pie, DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawArc(XPos As Double,
YPos As Double, Radius As Double, StartAngle As Double,
EndAngle As Double, Pie As Long, DrawOptions As Long) As Long
DLL
int DLDrawArc(int InstanceID, double XPos, double YPos, double Radius,
double StartAngle, double EndAngle, int Pie, int DrawOptions);
Parameters
XPos
Horizontal co-ordinate of the center of the arc
YPos
Vertical co-ordinate of center of the arc
Radius
Radius of the arc
StartAngle
Angle to start drawing from
EndAngle
Angle to end drawing at
Pie
Draw the arms of the arc:
0 = No
1 = Yes
DrawOptions
0 = Outline
1 = Fill
2 = Fill and Outline
3 = Close, Fill and Outline (if Pie = 1)
Copyright© 2007-2024 https://loslab.com
DrawBarcode
Vector graphics, Barcodes
Description
Draws a barcode on the selected page.
For Code128, the barcode is a combination of the "B" and "C" character sets resulting in the most compact representation.
GS1-128 barcodes (also known as EAN-128) can be drawn by setting the Barcode parameter to 3 (Code128) and using the
string "[FNC1]" in the appropriate place. For example:
"[FNC1]21ABC123[FNC1]2013"
The previous example indicates a serial number (AI 21) of "ABC123" and a product variant (AI 20) of "13".
Syntax
Delphi
function TPDFlib.DrawBarcode(Left, Top, Width,
Height: Double; Text: WideString; Barcode, Options: Integer): Integer;
ActiveX
Function PDFlib::DrawBarcode(Left As Double,
Top As Double, Width As Double, Height As Double,
Text As String, Barcode As Long, Options As Long) As Long
DLL
int DLDrawBarcode(int InstanceID, double Left, double Top, double Width,
double Height, wchar_t * Text, int Barcode, int Options);
Parameters
Left
Horizontal co-ordinate of left edge of the barcode
Top
Vertical co-ordinate of top edge of the barcode
Width
Width of the barcode
Height
Height of the barcode
Text
The barcode data. The barcode can be rotated by appending the following to the barcode data string:
/RC = Rotate clockwise
/RA = Rotate anti-clockwise
/RU = Rotate 180 degrees
Barcode
1 = Code39 (or Code 3 of 9)
2 = EAN-13
3 = Code128
4 = PostNet
5 = Interleaved 2 of 5
Options
Code39:
0 = Default drawing
EAN-13:
0 = Only draw the barcode
1 = Extend the guard bars
2 = Draw the human-readable numbers
3 = Draw the human-readable numbers, with right spacer
Code128:
0 = Default drawing
PostNet:
0 = Default drawing
Interleaved 2 of 5:
0 = Do not add a checksum, no bearer bars
1 = Add a checksum character, no bearer bars
2 = Do not add a checksum, draw bearer bars
3 = Add a checksum character, draw bearer bars
To apply 10% bar width reduction to the barcode, increase the value of the Options parameter by 10
Return values
0
The barcode could not be drawn. Invalid Barcode or Options parameters.
1
The barcode was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawBox
Vector graphics, Page manipulation
Description
Draw a rectangle on the selected page.
Syntax
Delphi
function TPDFlib.DrawBox(Left, Top, Width, Height: Double;
DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawBox(Left As Double,
Top As Double, Width As Double, Height As Double,
DrawOptions As Long) As Long
DLL
int DLDrawBox(int InstanceID, double Left, double Top, double Width,
double Height, int DrawOptions);
Parameters
Left
Horizontal co-ordinate of left edge of rectangle
Top
Vertical co-ordinate of top edge of rectangle
Width
Rectangle width
Height
Rectangle height
DrawOptions
0 = Outline
1 = Fill
2 = Fill and Outline
Copyright© 2007-2024 https://loslab.com
DrawCapturedPage
Page layout
Description
This function draws a page previously captured with the CapturePage function onto the current
page. It can be drawn at any size and position, allowing for imposition of pages.
You cannot use CapturePage to move pages from one document to another so all the required
pages must be merged into a single document before calling CapturePage. The CaptureID is just a
pointer to a hidden page therefore does not need to be released.
Syntax
Delphi
function TPDFlib.DrawCapturedPage(CaptureID: Integer; Left,
Top, Width, Height: Double): Integer;
ActiveX
Function PDFlib::DrawCapturedPage(
CaptureID As Long, Left As Double, Top As Double,
Width As Double, Height As Double) As Long
DLL
int DLDrawCapturedPage(int InstanceID, int CaptureID, double Left,
double Top, double Width, double Height);
Parameters
CaptureID The ID returned by the CapturePage function when a page was previously
captured
Left
The co-ordinate of the left edge of the destination area
Top
The co-ordinate of the top edge of the destination area
Width
The width of the destination area
Height
The height of the destination area
Return values
0
An invalid CaptureID was specified
1
The captured page was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawCapturedPageMatrix
Page layout
Description
This function draws a page previously captured with the CapturePage function onto the current
page. The size/position/rotation is specified using a transformation matrix, allowing for advanced
imposition of pages.
You cannot use CapturePage to move pages from one document to another so all the required
pages must be merged into a single document before calling CapturePage. The CaptureID is just a
pointer to a hidden page therefore does not need to be released.
Syntax
Delphi
function TPDFlib.DrawCapturedPageMatrix(CaptureID: Integer;
M11, M12, M21, M22, MDX, MDY: Double): Integer;
ActiveX
Function PDFlib::DrawCapturedPageMatrix(
CaptureID As Long, M11 As Double, M12 As Double, M21 As Double,
M22 As Double, MDX As Double,
MDY As Double) As Long
DLL
int DLDrawCapturedPageMatrix(int InstanceID, int CaptureID, double M11,
double M12, double M21, double M22, double MDX, double MDY);
Parameters
CaptureID The ID returned by the CapturePage function when a page was previously
captured
M11
Matrix component
M12
Matrix component
M21
Matrix component
M22
Matrix component
MDX
Matrix component
MDY
Matrix component
Return values
0
An invalid CaptureID was specified
1
The captured page was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawCircle
Vector graphics
Description
Draw a circle on the selected page.
Syntax
Delphi
function TPDFlib.DrawCircle(XPos, YPos, Radius: Double;
DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawCircle(XPos As Double,
YPos As Double, Radius As Double, DrawOptions As Long) As Long
DLL
int DLDrawCircle(int InstanceID, double XPos, double YPos, double Radius,
int DrawOptions);
Parameters
XPos
Horizontal co-ordinate of the center of the circle
YPos
Vertical co-ordinate of center of the circle
Radius
Size of the circle
DrawOptions
0 = Outline
1 = Fill
2 = Fill and Outline
Copyright© 2007-2024 https://loslab.com
DrawDataMatrixSymbol
Vector graphics, Barcodes
Description
This function draws a Data Matrix symbol onto the page. Data Matrix is a 2D barcode symbology allowing large amounts of data to be stored.
Syntax
Delphi
function TPDFlib.DrawDataMatrixSymbol(Left, Top,
ModuleSize: Double; Text: WideString; Encoding, SymbolSize,
Options: Integer): Integer;
ActiveX
Function PDFlib::DrawDataMatrixSymbol(
Left As Double, Top As Double, ModuleSize As Double, Text As
String, Encoding As Long, SymbolSize As Long, Options As
Long) As Long
DLL
int DLDrawDataMatrixSymbol(int InstanceID, double Left, double Top,
double ModuleSize, wchar_t * Text, int Encoding,
int SymbolSize, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the symbol
Top
The vertical co-ordinate of the top edge of the symbol
ModuleSize
This value is used for the width and height of the dots which make up the symbol
Text
The text/data to store in the symbol
Encoding
1 = ASCII encoding. See the Data Matrix specification for details.
SymbolSize
0 = Auto size
1 = 10x10
2 = 12x12
3 = 8x18
4 = 14x14
5 = 8x32
6 = 16x16
7 = 12x26
8 = 18x18
9 = 20x20
10 = 12x36
11 = 22x22
12 = 16x36
13 = 24x24
14 = 26x26
15 = 16x48
16 = 32x32
17 = 36x36
18 = 40x40
19 = 44x44
20 = 48x48
21 = 52x52
22 = 64x64
23 = 72x72
24 = 80x80
25 = 88x88
26 = 96x96
27 = 104x104
28 = 120x120
29 = 132x132
Options
0 = Normal
1 = Rotate 90 degrees counter clockwise
2 = Rotate 180 degrees
3 = Rotate 90 degrees clockwise
Add 100 to for 1 unit quiet zone (white border) - (default)
Add 200 to for 2 units quiet zone
Add 300 to for 3 units quiet zone
Add 400 to for 4 units quiet zone
Return values
0
The Encoding, SymbolSize or Options parameter was invalid
1
The Data Matrix symbol was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawEllipse
Vector graphics
Description
Draws an ellipse centered at a certain point which fits into the specified size box.
Syntax
Delphi
function TPDFlib.DrawEllipse(XPos, YPos, Width,
Height: Double; DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawEllipse(XPos As Double,
YPos As Double, Width As Double, Height As Double,
DrawOptions As Long) As Long
DLL
int DLDrawEllipse(int InstanceID, double XPos, double YPos, double Width,
double Height, int DrawOptions);
Parameters
XPos
The horizontal co-ordinate of the center of the ellipse
YPos
The vertical co-ordinate of the center of the ellipse
Width
The width of the ellipse
Height
The height of the ellipse
DrawOptions
0 = Outline
1 = Fill
2 = Fill and Outline
Copyright© 2007-2024 https://loslab.com
DrawEllipticArc
Vector graphics
Description
Draws an arc which is the result of cutting an ellipse between the start angle and the end angle.
The angles are measured anti-clockwise with 0 being at the top of the ellipse. ie. 12 O'Clock = 0
degrees and 9 O'Clock is 90 degrees.
Syntax
Delphi
function TPDFlib.DrawEllipticArc(XPos, YPos, Width, Height,
StartAngle, EndAngle: Double; Pie, DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawEllipticArc(XPos As Double,
YPos As Double, Width As Double, Height As Double,
StartAngle As Double, EndAngle As Double, Pie As Long, DrawOptions As
Long) As Long
DLL
int DLDrawEllipticArc(int InstanceID, double XPos, double YPos,
double Width, double Height, double StartAngle,
double EndAngle, int Pie, int DrawOptions);
Parameters
XPos
The horizontal co-ordinate of the center of the ellipse
YPos
The vertical co-ordinate of the center of the ellipse
Width
The width of the ellipse
Height
The height of the ellipse
StartAngle
The angle to start the curve at
EndAngle
The angle to end the curve at
Pie
Draw the arms of the arc:
0 = No
1 = Yes
DrawOptions
0 = Outline
1 = Fill
2 = Fill and Outline
3 = Close, Fill and Outline (if Pie = 1)
Copyright© 2007-2024 https://loslab.com
DrawHTMLText
Text, HTML text, Page layout
Description
Draws HTML text onto the page. See Appendix A for details of the supported HTML tags.
Syntax
Delphi
function TPDFlib.DrawHTMLText(Left, Top, Width: Double;
HTMLText: WideString): Integer;
ActiveX
Function PDFlib::DrawHTMLText(Left As Double,
Top As Double, Width As Double, HTMLText As String) As Long
DLL
int DLDrawHTMLText(int InstanceID, double Left, double Top, double Width,
wchar_t * HTMLText);
Parameters
Left
The left edge of the area to draw the text into
Top
The top edge of the area to draw the text into
Width
The width of the area to draw the text into
HTMLText
The HTML text to draw
Copyright© 2007-2024 https://loslab.com
DrawHTMLTextBox
Text, HTML text, Page layout
Description
Similar to the DrawHTMLText function, but the text drawn is limited to a specific area. The
remaining HTML text is returned, which can be passed to this function again (perhaps on a
different page or location) until the function returns an empty string. See Appendix A for details
of the supported HTML tags.
Syntax
Delphi
function TPDFlib.DrawHTMLTextBox(Left, Top, Width,
Height: Double; HTMLText: WideString): WideString;
ActiveX
Function PDFlib::DrawHTMLTextBox(Left As Double,
Top As Double, Width As Double, Height As Double,
HTMLText As String) As String
DLL
wchar_t * DLDrawHTMLTextBox(int InstanceID, double Left, double Top,
double Width, double Height, wchar_t * HTMLText);
Parameters
Left
Horizontal co-ordinate of the left edge of the drawing area
Top
Vertical co-ordinate of the top edge of the drawing area
Width
The width of the drawing area
Height
The height of the drawing area
HTMLText
The HTML text to draw
Return values
LeftOverText
A "string" containing the text that did not fit into the TextBox. This value can
be resused to draw the undrawn text into a new text box often on the next
page.
Copyright© 2007-2024 https://loslab.com
DrawHTMLTextBoxMatrix
Text, HTML text, Page layout
Description
Similar to the DrawHTMLTextBox function but the position/scaling/rotation is specified using a
transformation matrix.
The remaining HTML text is returned, which can be passed to this function again (perhaps on a
different page or location) until the function returns an empty string.
See Appendix A for details of the supported HTML tags.
Syntax
Delphi
function TPDFlib.DrawHTMLTextBoxMatrix(Width,
Height: Double; HTMLText: WideString; M11, M12, M21, M22, MDX,
MDY: Double): WideString;
ActiveX
Function PDFlib::DrawHTMLTextBoxMatrix(
Width As Double, Height As Double, HTMLText As String,
M11 As Double, M12 As Double, M21 As Double, M22 As Double,
MDX As Double, MDY As Double) As String
DLL
wchar_t * DLDrawHTMLTextBoxMatrix(int InstanceID, double Width,
double Height, wchar_t * HTMLText, double M11, double M12,
double M21, double M22, double MDX, double MDY);
Parameters
Width
The width of the drawing area
Height
The height of the drawing area
HTMLText
The HTML text to draw
M11
Matrix component
M12
Matrix component
M21
Matrix component
M22
Matrix component
MDX
Matrix component
MDY
Matrix component
Copyright© 2007-2024 https://loslab.com
DrawHTMLTextMatrix
HTML text, Page layout
Description
Similar to the DrawHTMLText function but the position/scaling/rotation is specified using a
transformation matrix.
See Appendix A for details of the supported HTML tags.
Syntax
Delphi
function TPDFlib.DrawHTMLTextMatrix(Width: Double;
HTMLText: WideString; M11, M12, M21, M22, MDX, MDY: Double): Integer;
ActiveX
Function PDFlib::DrawHTMLTextMatrix(
Width As Double, HTMLText As String, M11 As Double,
M12 As Double, M21 As Double, M22 As Double, MDX As Double,
MDY As Double) As Long
DLL
int DLDrawHTMLTextMatrix(int InstanceID, double Width,
wchar_t * HTMLText, double M11, double M12, double M21,
double M22, double MDX, double MDY);
Parameters
Width
The width of the area to draw the text into
HTMLText
The HTML text to draw
M11
Matrix component
M12
Matrix component
M21
Matrix component
M22
Matrix component
MDX
Matrix component
MDY
Matrix component
Copyright© 2007-2024 https://loslab.com
DrawImage
Image handling, Page layout
Description
Draw the selected image on the page.
Syntax
Delphi
function TPDFlib.DrawImage(Left, Top, Width,
Height: Double): Integer;
ActiveX
Function PDFlib::DrawImage(Left As Double,
Top As Double, Width As Double, Height As Double) As Long
DLL
int DLDrawImage(int InstanceID, double Left, double Top, double Width,
double Height);
Parameters
Left
Horizontal co-ordinate of the left edge of the image
Top
Vertical co-ordinate of the top edge of the image
Width
Width of the image
Height
Height of the image
Return values
0
An image has not been selected
1
The image was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawImageMatrix
Image handling, Page layout
Description
Draws the selected image on the page using a transformation matrix.
Syntax
Delphi
function TPDFlib.DrawImageMatrix(M11, M12, M21, M22, MDX,
MDY: Double): Integer;
ActiveX
Function PDFlib::DrawImageMatrix(M11 As Double,
M12 As Double, M21 As Double, M22 As Double, MDX As Double,
MDY As Double) As Long
DLL
int DLDrawImageMatrix(int InstanceID, double M11, double M12, double M21,
double M22, double MDX, double MDY);
Parameters
M11
Matrix component
M12
Matrix component
M21
Matrix component
M22
Matrix component
MDX
Matrix component
MDY
Matrix component
Return values
0
An image has not been selected
1
The image was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawIntelligentMailBarcode
Vector graphics, Barcodes
Description
This function draws a USPS Intelligent Mail (also known as OneCode) barcode onto the page.
Syntax
Delphi
function TPDFlib.DrawIntelligentMailBarcode(Left, Top,
BarWidth, FullBarHeight, TrackerHeight, SpaceWidth: Double;
BarcodeData: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::DrawIntelligentMailBarcode(
Left As Double, Top As Double, BarWidth As Double, FullBarHeight As
Double, TrackerHeight As Double, SpaceWidth As Double, BarcodeData
As String, Options As Long) As Long
DLL
int DLDrawIntelligentMailBarcode(int InstanceID, double Left, double Top,
double BarWidth, double FullBarHeight, double TrackerHeight,
double SpaceWidth, wchar_t * BarcodeData, int Options);
Parameters
Left
Horizontal co-ordinate of the left edge of the barcode
Top
Vertical co-ordinate of the top edge of the barcode
BarWidth
The width of the bars
FullBarHeight
The height of a full bar
TrackerHeight
The height of a tracker bar
SpaceWidth
The width of the spaces between the bars
BarcodeData
The barcode data to encode. This should be a 20, 25, 29 or 31 character
string containing only the digits 0 to 9. No spaces or any other non-numeric
characters will be accepted. The second digit has a maximum value of 4.
Options
0 = Normal
10 = Bar width reduction
Return values
0
The barcode could not be drawn
1
The barcode was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawLine
Vector graphics
Description
Draws a line between two points.
Syntax
Delphi
function TPDFlib.DrawLine(StartX, StartY, EndX,
EndY: Double): Integer;
ActiveX
Function PDFlib::DrawLine(StartX As Double,
StartY As Double, EndX As Double, EndY As Double) As Long
DLL
int DLDrawLine(int InstanceID, double StartX, double StartY, double EndX,
double EndY);
Parameters
StartX
Horizontal co-ordinate of start point
StartY
Vertical co-ordinate of start point
EndX
Horizontal co-ordinate of end point
EndY
Vertical co-ordinate of end point
Copyright© 2007-2024 https://loslab.com
DrawMultiLineText
Text, Page layout
Description
Draw text which is wrapped at a specific delimiter
.
The SetTextAlign function can be used to change the alignment of the text.
Syntax
Delphi
function TPDFlib.DrawMultiLineText(XPos, YPos: Double;
Delimiter, Text: WideString): Integer;
ActiveX
Function PDFlib::DrawMultiLineText(
XPos As Double, YPos As Double, Delimiter As String,
Text As String) As Long
DLL
int DLDrawMultiLineText(int InstanceID, double XPos, double YPos,
wchar_t * Delimiter, wchar_t * Text);
Parameters
XPos
The horizontal reference point of the text block
YPos
The baseline of the first line of text
Delimiter
The delimiter to use when splitting the text into lines. The only valid characters to
use as the delimiter are characters which have a "width", as well as the CR and LF
characters (ASCII values 13 and 10).
Text
The text to draw
Copyright© 2007-2024 https://loslab.com
DrawPDF417Symbol
Vector graphics, Barcodes
Description
Draws a PDF417 symbol onto the selected page.
The DrawPDF417SymbolEx function can be used for extra functionality.
Syntax
Delphi
function TPDFlib.DrawPDF417Symbol(Left, Top: Double;
Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::DrawPDF417Symbol(Left As Double,
Top As Double, Text As String, Options As Long) As Long
DLL
int DLDrawPDF417Symbol(int InstanceID, double Left, double Top,
wchar_t * Text, int Options);
Parameters
Left
The horizontal coordinate of the left edge of the PDF417 symbol
Top
The vertical coordinate of the top edge of the PDF417 symbol
Text
The text to store in the symbol
Options
0 = Normal
1 = Rotate 90 degrees counter clockwise
2 = Rotate 180 degrees
3 = Rotate 90 degrees clockwise
Return values
0
The Options parameter was invalid
1
The PDF417 symbol was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawPDF417SymbolEx
Vector graphics, Barcodes
Description
Draws a PDF417 symbol onto the selected page.
Similar to DrawPDF417Symbol but providing extra functionality.
Syntax
Delphi
function TPDFlib.DrawPDF417SymbolEx(Left, Top: Double;
Text: WideString; Options, FixedColumns, FixedRows, ErrorLevel: Integer;
ModuleSize, HeightWidthRatio: Double): Integer;
ActiveX
Function PDFlib::DrawPDF417SymbolEx(
Left As Double, Top As Double, Text As String,
Options As Long, FixedColumns As Long, FixedRows As Long,
ErrorLevel As Long, ModuleSize As Double, HeightWidthRatio
As Double) As Long
DLL
int DLDrawPDF417SymbolEx(int InstanceID, double Left, double Top,
wchar_t * Text, int Options, int FixedColumns, int FixedRows,
int ErrorLevel, double ModuleSize, double HeightWidthRatio);
Parameters
Left
The horizontal coordinate of the left edge of the PDF417 symbol
Top
The vertical coordinate of the top edge of the PDF417 symbol
Text
The text to store in the symbol
Options
0 = Normal
1 = Rotate 90 degrees counter clockwise
2 = Rotate 180 degrees
3 = Rotate 90 degrees clockwise
FixedColumns
0 = Auto
Non-zero = fixed number of columns
FixedRows
0 = Auto
Non-zero = fixed number of rows
ErrorLevel
-1 = Auto
0 to 8 = User error level
ModuleSize
The width of the smallest element in units defined by a call to
SetMeasurementUnits
HeightWidthRatio
The ratio of the needed module height to the module width
Return values
0
One of the parameters was invalid or the text was too big for the symbol
site.
1
The PDF417 symbol was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawPath
Vector graphics, Path definition and drawing
Description
Draws the path defined by calls to StartPath, AddLineToPath, AddCurveToPath and/or
ClosePath.
Syntax
Delphi
function TPDFlib.DrawPath(PathOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawPath(
PathOptions As Long) As Long
DLL
int DLDrawPath(int InstanceID, int PathOptions);
Parameters
PathOptions
0 = Outline
1 = Fill
2 = Fill and Outline
Copyright© 2007-2024 https://loslab.com
DrawPathEvenOdd
Vector graphics, Path definition and drawing
Description
Similar to the DrawPath function, but draws the path using the "even odd" method. This is
important when different parts of the path overlap.
Syntax
Delphi
function TPDFlib.DrawPathEvenOdd(
PathOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawPathEvenOdd(
PathOptions As Long) As Long
DLL
int DLDrawPathEvenOdd(int InstanceID, int PathOptions);
Parameters
PathOptions
0 = Outline
1 = Fill
2 = Fill and outline
Copyright© 2007-2024 https://loslab.com
DrawPostScriptXObject
Annotations and hotspot links, Page layout
Description
Adds a reference to a PostScript XObject at the current position in the page contents.
This function is for specific advanced use and will not be useful to the majority of users.
For historical reasons, the PDF specification allows raw PostScript language commands to be
embedded inside a document.
When the document is printed (using certain PDF software tools) on a PostScript printer, these raw
PostScript commands will be sent directly to the printer.
Most PDF viewers are not able to display this embedded PostScript because this would require a full
PostScript language interpreter.
Syntax
Delphi
function TPDFlib.DrawPostScriptXObject(
PSRef: Integer): Integer;
ActiveX
Function PDFlib::DrawPostScriptXObject(
PSRef As Long) As Long
DLL
int DLDrawPostScriptXObject(int InstanceID, int PSRef);
Parameters
PSRef A value that was returned by the NewPostScriptXObject function
Return values
0
The PostScript XObject could not be drawn
1
The PostScript XObject was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawQRCode
Vector graphics, Barcodes
Description
Draws a QR Code onto the selected page.
Syntax
Delphi
function TPDFlib.DrawQRCode(Left, Top, SymbolSize: Double;
Text: WideString; EncodeOptions, DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawQRCode(Left As Double,
Top As Double, SymbolSize As Double, Text As String,
EncodeOptions As Long, DrawOptions As Long) As Long
DLL
int DLDrawQRCode(int InstanceID, double Left, double Top,
double SymbolSize, wchar_t * Text, int EncodeOptions,
int DrawOptions);
Parameters
Left
The horizontal coordinate of the left edge of the QR Code
Top
The vertical coordinate of the top edge of the QR Code
SymbolSize
The width and height of the QR Code
Text
The text to encode in the QR Code
EncodeOptions
0=Auto
1=Numeric
2=Alphanumeric
3=ISO-8859-1
4=UTF-8 with BOM
5=UTF-8 without BOM
DrawOptions
0 = Normal
1 = Rotate 90 degrees counter clockwise
2 = Rotate 180 degrees
3 = Rotate 90 degrees clockwise
Return values
0
The QR Code could not be drawn, check for an out of range value for the
EncodeOptions or DrawOptions parameter.
1
The QR Code was drawn successfully.
Copyright© 2007-2024 https://loslab.com
DrawRotatedBox
Vector graphics, Page manipulation
Description
Draws a rotated rectangle on the selected page.
Syntax
Delphi
function TPDFlib.DrawRotatedBox(Left, Bottom, Width, Height,
Angle: Double; DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawRotatedBox(Left As Double,
Bottom As Double, Width As Double, Height As Double,
Angle As Double, DrawOptions As Long) As Long
DLL
int DLDrawRotatedBox(int InstanceID, double Left, double Bottom,
double Width, double Height, double Angle, int DrawOptions);
Parameters
Left
The horizontal co-ordinate of the anchor point
Bottom
The vertical co-ordinate of the anchor point
Width
The width of the rectangle
Height
The height of the rectangle
Angle
The angle to rotate the rectangle, measured anti-clockwise in degrees from the
baseline, around the anchor point (bottom-left of the rectangle)
DrawOptions
0 = Outline
1 = Fill
2 = Fill and Outline
Copyright© 2007-2024 https://loslab.com
DrawRotatedCapturedPage
Page layout, Page manipulation
Description
Similar to the DrawCapturedPage function, but allows the captured page to be drawn at any
angle. Note that the anchor point is the bottom-left corner, not the top-left corner as with the
DrawCapturedPage function.
Syntax
Delphi
function TPDFlib.DrawRotatedCapturedPage(CaptureID: Integer;
Left, Bottom, Width, Height, Angle: Double): Integer;
ActiveX
Function PDFlib::DrawRotatedCapturedPage(
CaptureID As Long, Left As Double, Bottom As Double,
Width As Double, Height As Double, Angle As Double) As Long
DLL
int DLDrawRotatedCapturedPage(int InstanceID, int CaptureID, double Left,
double Bottom, double Width, double Height, double Angle);
Parameters
CaptureID The ID returned by the CapturePage function
Left
The horizontal co-ordinate of the anchor point
Bottom
The vertical co-ordinate of the anchor point
Width
The width of the rectangle to place the captured page in
Height
The height of the rectangle to place the captured page in
Angle
The angle to rotate the captured page by, measured anti-clockwise in degrees
from the baseline
Return values
0
The CaptureID was not valid
1
The captured page was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawRotatedImage
Image handling, Page layout
Description
Similar to the DrawImage function but the image can be rotated at any angle. Note that the
anchor point is the bottom left corner of the image, not the top-left as in the DrawImage
function.
Syntax
Delphi
function TPDFlib.DrawRotatedImage(Left, Bottom, Width,
Height, Angle: Double): Integer;
ActiveX
Function PDFlib::DrawRotatedImage(Left As Double,
Bottom As Double, Width As Double, Height As Double,
Angle As Double) As Long
DLL
int DLDrawRotatedImage(int InstanceID, double Left, double Bottom,
double Width, double Height, double Angle);
Parameters
Left
The horizontal co-ordinate of the anchor point
Bottom
The vertical co-ordinate of the anchor point
Width
The width of the image
Height
The height of the image
Angle
The angle to rotate the image, measured anti-clockwise in degrees from the
baseline, around the anchor point (bottom-left of the image)
Return values
0
No image has been selected
1
The image was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawRotatedMultiLineText
Text, Page layout
Description
Draws rotated text which is wrapped at a specific delimiter.
The SetTextAlign function can be used to change the alignment of the text.
The first line of text will start with the baseline at the anchor point used for rotation.
Syntax
Delphi
function TPDFlib.DrawRotatedMultiLineText(XPos, YPos,
Angle: Double; Delimiter, Text: WideString): Integer;
ActiveX
Function PDFlib::DrawRotatedMultiLineText(
XPos As Double, YPos As Double, Angle As Double,
Delimiter As String, Text As String) As Long
DLL
int DLDrawRotatedMultiLineText(int InstanceID, double XPos, double YPos,
double Angle, wchar_t * Delimiter, wchar_t * Text);
Parameters
XPos
The horizontal coordinate of the anchor point
YPos
The vertical coordinate of the anchor point
Angle
The angle to rotate the text, measured anti-clockwise in degrees from the baseline,
around the anchor point
Delimiter
The delimiter to use when splitting the text into lines. The only valid characters to
use as the delimiter are characters which have a "width", as well as the CR and LF
characters (ASCII values 13 and 10).
Text
The text to draw
Copyright© 2007-2024 https://loslab.com
DrawRotatedText
Text, Page layout
Description
Draws text on the selected page, using the selected font at the predetermined font size. If no fonts
have been added, then the standard font Helvetica will automatically be added, selected and set to
12pt. The alignment of the text is determined by the previous call to the SetTextAlign function.
Syntax
Delphi
function TPDFlib.DrawRotatedText(XPos, YPos, Angle: Double;
Text: WideString): Integer;
ActiveX
Function PDFlib::DrawRotatedText(XPos As Double,
YPos As Double, Angle As Double, Text As String) As Long
DLL
int DLDrawRotatedText(int InstanceID, double XPos, double YPos,
double Angle, wchar_t * Text);
Parameters
XPos
The horizontal position of where to draw the text
YPos
The vertical position of where to draw the text. The reference point is the text
baseline.
Angle
The angle to draw the text, measured anti-clockwise from the horizontal. Must be
between 0 and 360, inclusive.
Text
The text to draw on the page
Return values
0
The Angle parameter was less than 0 or greater than 360, or the Text parameter
was blank
1
The text was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawRotatedTextBox
Text, Page layout
Description
Similar to the DrawTextBox function, but allows the text box to be rotated at any angle.
Syntax
Delphi
function TPDFlib.DrawRotatedTextBox(Left, Top, Width,
Height, Angle: Double; Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::DrawRotatedTextBox(
Left As Double, Top As Double, Width As Double,
Height As Double, Angle As Double, Text As String, Options
As Long) As Long
DLL
int DLDrawRotatedTextBox(int InstanceID, double Left, double Top,
double Width, double Height, double Angle, wchar_t * Text,
int Options);
Parameters
Left
The horizontal co-ordinate of the top-left corner of the text box
Top
The vertical co-ordinate of the top-left corner of the text box
Width
The width of the box
Height
The height of the box
Angle
The angle the box should be rotated around the top-left corner, measured
anti-clockwise in degrees
Text
The text to place in the box
Options
0 = Center vertical alignment
1 = Top vertical alignment
2 = Bottom vertical alignment
3 = Center vertical alignment, no wrapping
4 = Top vertical alignment, no wrapping
5 = Bottom vertical alignment, no wrapping
Return values
0
The Options parameter was out of range, or the Width parameter was too small to
contain any text
Non-zero
The number of lines of text actually drawn
Copyright© 2007-2024 https://loslab.com
DrawRotatedTextBoxEx
Text, Page layout
Description
Similar to the DrawRotatedTextBoxEx function, but allows the text box to show borders.
Syntax
Delphi
function TPDFlib.DrawRotatedTextBoxEx(Left, Top, Width,
Height, Angle: Double; Text: WideString; Options, Border, Radius,
DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawRotatedTextBoxEx(
Left As Double, Top As Double, Width As Double,
Height As Double, Angle As Double, Text As String, Options As
Long, Border As Long, Radius As Long, DrawOptions As Long) As
Long
DLL
int DLDrawRotatedTextBoxEx(int InstanceID, double Left, double Top,
double Width, double Height, double Angle, wchar_t * Text,
int Options, int Border, int Radius, int DrawOptions);
Parameters
Left
The horizontal co-ordinate of the top-left corner of the text box
Top
The vertical co-ordinate of the top-left corner of the text box
Width
The width of the box
Height
The height of the box
Angle
The angle the box should be rotated around the top-left corner, measured
anti-clockwise in degrees
Text
The text to draw on the page
Options
0 = Center vertical alignment
1 = Top vertical alignment
2 = Bottom vertical alignment
3 = Center vertical alignment, no wrapping
4 = Top vertical alignment, no wrapping
5 = Bottom vertical alignment, no wrapping
Border
0 = No Border
1 = Border
2 = Border with rounded corners
Radius
Radius of the corner arcs
DrawOptions
0 = Outline
1 = Fill
2 = Fill and outline
Return values
0
The Options parameter was out of range, or the Width parameter was too
small to contain any text
Non-zero
The number of lines of text actually drawn
Copyright© 2007-2024 https://loslab.com
DrawRoundedBox
Vector graphics, Page layout
Description
Draw a rectangle with rounded corners on the selected page.
Syntax
Delphi
function TPDFlib.DrawRoundedBox(Left, Top, Width, Height,
Radius: Double; DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawRoundedBox(Left As Double,
Top As Double, Width As Double, Height As Double,
Radius As Double, DrawOptions As Long) As Long
DLL
int DLDrawRoundedBox(int InstanceID, double Left, double Top,
double Width, double Height, double Radius, int DrawOptions);
Parameters
Left
Horizontal co-ordinate of left edge of rectangle
Top
Vertical co-ordinate of top edge of rectangle
Width
Rectangle width
Height
Rectangle height
Radius
Radius of the corner arcs
DrawOptions
0 = Outline
1 = Fill
2 = Fill and outline
Copyright© 2007-2024 https://loslab.com
DrawRoundedRotatedBox
Vector graphics, Page layout
Description
Draw a rotated rectangle with rounded corners on the selected page.
Syntax
Delphi
function TPDFlib.DrawRoundedRotatedBox(Left, Bottom, Width,
Height, Radius, Angle: Double; DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawRoundedRotatedBox(
Left As Double, Bottom As Double, Width As Double, Height As
Double, Radius As Double, Angle As Double, DrawOptions As
Long) As Long
DLL
int DLDrawRoundedRotatedBox(int InstanceID, double Left, double Bottom,
double Width, double Height, double Radius, double Angle,
int DrawOptions);
Parameters
Left
Horizontal co-ordinate of left edge of rectangle
Bottom
Vertical co-ordinate of bottom edge of rectangle
Width
Rectangle width
Height
Rectangle height
Radius
Radius of the corner arcs
Angle
The angle the box should be rotated around the bottom-left corner, measured
anti-clockwise in degrees
DrawOptions
0 = Outline
1 = Fill
2 = Fill and outline
Copyright© 2007-2024 https://loslab.com
DrawScaledImage
Image handling, Page layout
Description
Draw the selected image on the page. The image is drawn at the scale specified, assuming 72 DPI
for both the horizontal and vertical resolution.
Syntax
Delphi
function TPDFlib.DrawScaledImage(Left, Top,
Scale: Double): Integer;
ActiveX
Function PDFlib::DrawScaledImage(Left As Double,
Top As Double, Scale As Double) As Long
DLL
int DLDrawScaledImage(int InstanceID, double Left, double Top,
double Scale);
Parameters
Left
Horizontal co-ordinate of the left edge of the image
Top
Vertical co-ordinate of the top edge of the image
Scale
The scale to use, for example:
0.5 = 50%
1 = 100%
Return values
0
An image was not selected
1
The image was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawSpacedText
Text, Page layout
Description
Draws text on the selected page, using the selected font at the predetermined font size. If no fonts
have been added, then the 12 pt Helvetica will automatically be added and selected. Each
character will be spaced at regular intervals. The individual characters will be aligned relative to the
XPos variable depending on how the SetTextAlign function has been used.
Syntax
Delphi
function TPDFlib.DrawSpacedText(XPos, YPos, Spacing: Double;
Text: WideString): Integer;
ActiveX
Function PDFlib::DrawSpacedText(XPos As Double,
YPos As Double, Spacing As Double, Text As String) As Long
DLL
int DLDrawSpacedText(int InstanceID, double XPos, double YPos,
double Spacing, wchar_t * Text);
Parameters
XPos
The horizontal position of where to draw the text
YPos
The vertical position of where to draw the text. The reference point is the text
baseline.
Spacing
The spacing between the same point on each character
Text
The text to draw on the page
Copyright© 2007-2024 https://loslab.com
DrawTableRows
Page layout
Description
Draws multiple rows from the specified table onto the selected page and returns the total height of
the drawn rows.
Only the number of rows that fit into the specified height will be drawn. Use the
GetTableLastDrawnRow function to determine the row number of the last row.
The value returned by this function is scaled according to the current co-ordinate system settings
as set by the SetMeasurementUnits function.
Syntax
Delphi
function TPDFlib.DrawTableRows(TableID: Integer; Left, Top,
Height: Double; FirstRow, LastRow: Integer): Double;
ActiveX
Function PDFlib::DrawTableRows(TableID As Long,
Left As Double, Top As Double, Height As Double,
FirstRow As Long, LastRow As Long) As Double
DLL
double DLDrawTableRows(int InstanceID, int TableID, double Left,
double Top, double Height, int FirstRow, int LastRow);
Parameters
TableID A TableID returned by the CreateTable function
Left
The horizontal distance from the origin to the left edge of the table
Top
The vertical distance from the origin to the top of the table
Height
The maximum height available to draw the table in
FirstRow
The the number of the first row to draw. Top row is row number 1.
LastRow
0 = All remaining rows
Non-zero = The number of the final row to set
Return values
0
No rows were drawn
Non-zero
The total height of all the rows that were drawn onto the page.
Copyright© 2007-2024 https://loslab.com
DrawText
Text, Page layout
Description
Draws text on the selected page, using the selected font at the predetermined font size. If no fonts
have been added, then 12 pt Helvetica will automatically be added and selected. The alignment of
the text can be changed with the SetTextAlign function.
Syntax
Delphi
function TPDFlib.DrawText(XPos, YPos: Double;
Text: WideString): Integer;
ActiveX
Function PDFlib::DrawText(XPos As Double,
YPos As Double, Text As String) As Long
DLL
int DLDrawText(int InstanceID, double XPos, double YPos, wchar_t * Text);
Parameters
XPos
The horizontal position of where to draw the text. The reference point is usually to
the left of the first character, unless the SetTextAlign function has been used to
change the alignment.
YPos
The vertical position of where to draw the text. The reference point is the text
baseline.
Text
The text to draw on the page
Copyright© 2007-2024 https://loslab.com
DrawTextArc
Text, Page layout
Description
Draws text fitted to an imaginary arc with the specified center point and radius. The text will be
drawn with it's left edge at the requested angle, where 0 degrees is the "12 o'clock" position, and
positive angles are clockwise. The SetTextAlign function can be used to change the alignment of
the text relative to the specified angle.
Syntax
Delphi
function TPDFlib.DrawTextArc(XPos, YPos, Radius,
Angle: Double; Text: WideString; DrawOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawTextArc(XPos As Double,
YPos As Double, Radius As Double, Angle As Double,
Text As String, DrawOptions As Long) As Long
DLL
int DLDrawTextArc(int InstanceID, double XPos, double YPos,
double Radius, double Angle, wchar_t * Text, int DrawOptions);
Parameters
XPos
The horizontal co-ordinate of the center of the arc
YPos
The vertical co-ordinate of the center of the arc
Radius
The radius of the arc
Angle
The angle at which the text should be placed
Text
The actual text to draw
DrawOptions
0 = Draw the text outside the arc in a clockwise direction
1 = Draw the text inside the arc in an anti-clockwise direction
Return values
0
The text was blank or the DrawOptions parameter was out of range
1
The text was drawn successfully
Copyright© 2007-2024 https://loslab.com
DrawTextBox
Text, Page layout
Description
This function is similar to the DrawText function, but the text is placed within the bounding box
specified. The vertical alignment can be set using the Options parameter, and the horizontal
alignment can be set with the SetTextAlign function. The text will be word-wrapped to fit inside
the bounding box.
Syntax
Delphi
function TPDFlib.DrawTextBox(Left, Top, Width,
Height: Double; Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::DrawTextBox(Left As Double,
Top As Double, Width As Double, Height As Double,
Text As String, Options As Long) As Long
DLL
int DLDrawTextBox(int InstanceID, double Left, double Top, double Width,
double Height, wchar_t * Text, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the bounding box
Top
The vertical co-ordinate of the top edge of the bounding box
Width
The width of the bounding box
Height
The height of the bounding box
Text
The text to draw on the page
Options
0 = Center vertical alignment
1 = Top vertical alignment
2 = Bottom vertical alignment
3 = Center vertical alignment, no wrapping
4 = Top vertical alignment, no wrapping
5 = Bottom vertical alignment, no wrapping
Return values
0
The Options parameter was out of range, or the Width parameter was too small to
contain any text
Non-zero
The number of lines of text actually drawn
Copyright© 2007-2024 https://loslab.com
DrawTextBoxMatrix
Text, Page layout
Description
This function is similar to the DrawTextBox function but the position/scaling/rotation is specified
using a transformation matrix.
The vertical alignment can be set using the Options parameter, and the horizontal alignment can be
set with the SetTextAlign function. The text will be word-wrapped to fit inside the bounding box.
Syntax
Delphi
function TPDFlib.DrawTextBoxMatrix(Width, Height: Double;
Text: WideString; Options: Integer; M11, M12, M21, M22, MDX,
MDY: Double): Integer;
ActiveX
Function PDFlib::DrawTextBoxMatrix(
Width As Double, Height As Double, Text As String,
Options As Long, M11 As Double, M12 As Double, M21 As Double,
M22 As Double, MDX As Double, MDY As Double) As Long
DLL
int DLDrawTextBoxMatrix(int InstanceID, double Width, double Height,
wchar_t * Text, int Options, double M11, double M12,
double M21, double M22, double MDX, double MDY);
Parameters
Width
The width of the bounding box
Height
The height of the bounding box
Text
The text to draw on the page
Options
0 = Center vertical alignment
1 = Top vertical alignment
2 = Bottom vertical alignment
3 = Center vertical alignment, no wrapping
4 = Top vertical alignment, no wrapping
5 = Bottom vertical alignment, no wrapping
M11
Matrix component
M12
Matrix component
M21
Matrix component
M22
Matrix component
MDX
Matrix component
MDY
Matrix component
Return values
0
The Options parameter was out of range, or the Width parameter was too small to
contain any text
Non-zero
The number of lines of text actually drawn
Copyright© 2007-2024 https://loslab.com
DrawWrappedText
Text, Page layout
Description
Draw text which is wrapped to a certain width. The SetTextAlign function can be used to change
the alignment of the text. The SetBreakString function can be used to set the delimiter for the
linebreak. The default is CR / LF pair. On some systems a LF may be default.
Syntax
Delphi
function TPDFlib.DrawWrappedText(XPos, YPos, Width: Double;
Text: WideString): Integer;
ActiveX
Function PDFlib::DrawWrappedText(XPos As Double,
YPos As Double, Width As Double, Text As String) As Long
DLL
int DLDrawWrappedText(int InstanceID, double XPos, double YPos,
double Width, wchar_t * Text);
Parameters
XPos
The left edge of the text block
YPos
The baseline of the first line of text
Width
The width of the text block
Text
The text to draw
Copyright© 2007-2024 https://loslab.com
EditableContentStream
Content Streams and Optional Content Groups
Description
Use this function to determine if the content stream part that was selected with the
SelectContentStream function can be drawn on.
Syntax
Delphi
function TPDFlib.EditableContentStream: Integer;
ActiveX
Function PDFlib::EditableContentStream As Long
DLL
int DLEditableContentStream(int InstanceID);
Return values
0
The selected content stream part cannot be drawn on
1
The selected content stream part is editable
Copyright© 2007-2024 https://loslab.com
EmbedFile
Document properties
Description
Embeds a file into the PDF document and creates a file attachment link to the embedded file. The
file can then be accessed in Acrobat under the File Attachments function.
This is equivalent to calling AddEmbeddedFile followed by AddFileAttachment.
Syntax
Delphi
function TPDFlib.EmbedFile(Title, FileName,
MIMEType: WideString): Integer;
ActiveX
Function PDFlib::EmbedFile(Title As String,
FileName As String, MIMEType As String) As Long
DLL
int DLEmbedFile(int InstanceID, wchar_t * Title, wchar_t * FileName,
wchar_t * MIMEType);
Parameters
Title
A unique title for this file. No two files can have the same title. If a file with this
title already exists in the document the new file will not be embedded.
FileName
The full path and name of the file to embed.
MIMEType
The optional MIME type of the file, for example "image/jpg" for a JPEG image. See
http://www.iana.org/assignments/media-types/ for a full list of MIME types. If the
MIME type is not known it can be set to an empty string.
Return values
0
The file could not be embedded
1
The file was embedded successfully
Copyright© 2007-2024 https://loslab.com
EmbeddedFileCount
Document properties
Description
Returns the number of embedded files in the document.
This total only includes embedded files that are listed as file attachments and does not include
embedded files that are only referenced by a link annotation.
Syntax
Delphi
function TPDFlib.EmbeddedFileCount: Integer;
ActiveX
Function PDFlib::EmbeddedFileCount As Long
DLL
int DLEmbeddedFileCount(int InstanceID);
Copyright© 2007-2024 https://loslab.com
EncapsulateContentStream
Content Streams and Optional Content Groups
Description
A page in a PDF document has one or more content stream parts that together contain all the PDF
page description commands for the page.
This function combines the content stream parts and surrounds the content stream with "save
graphics state" and "restore graphics state" operators. This has the effect of clearing the current
clipping path.
Some pages may contain unbalanced "save graphics state" and "restore graphics state" operators.
The BalanceContentStream function can be used to repair such pages.
Syntax
Delphi
function TPDFlib.EncapsulateContentStream: Integer;
ActiveX
Function PDFlib::EncapsulateContentStream As Long
DLL
int DLEncapsulateContentStream(int InstanceID);
Copyright© 2007-2024 https://loslab.com
EncodePermissions
Security and Signatures
Description
Create a value for the Permissions parameter of the Encrypt function.
Syntax
Delphi
function TPDFlib.EncodePermissions(CanPrint, CanCopy,
CanChange, CanAddNotes, CanFillFields, CanCopyAccess, CanAssemble,
CanPrintFull: Integer): Integer;
ActiveX
Function PDFlib::EncodePermissions(
CanPrint As Long, CanCopy As Long, CanChange As Long,
CanAddNotes As Long, CanFillFields As Long, CanCopyAccess
As Long, CanAssemble As Long, CanPrintFull As Long) As
Long
DLL
int DLEncodePermissions(int InstanceID, int CanPrint, int CanCopy,
int CanChange, int CanAddNotes, int CanFillFields,
int CanCopyAccess, int CanAssemble, int CanPrintFull);
Parameters
CanPrint
Set this to 1 to allow the user to print the document
CanCopy
Set this to 1 to allow the user to copy text and graphics from the document
CanChange
Set this to 1 to allow the user to edit the document
CanAddNotes
Set this to 1 to allow the user to add annotations
CanFillFields
Set this to 1 to allow the user to fill in form fields. Only works with 128-bit
encryption.
CanCopyAccess
Set this to 1 to enable copying for use with accessibility features. Only works
with 128-bit encryption.
CanAssemble
Set this to 1 to allow the user to assemble the document. Only works with
128-bit encryption.
CanPrintFull
Set this to 0 to force low-resolution printing of the document only. This
prevents the document from being distilled into a new PDF document. Only
works with 128-bit encryption or higher.
Return values
Result is a 32-bit encoded number which should be passed to the Encrypt
function
Copyright© 2007-2024 https://loslab.com
EncodeStringFromVariant
Text, Miscellaneous functions
Description
This function is used to encode a string in UTF-16LE format from an array of numbers stored as a
Variant type.
Syntax
ActiveX
Function PDFlib::EncodeStringFromVariant(
NumberList As Variant, Encoding As String,
UnmatchedAction As Long) As String
Parameters
NumberList
A variant array of numbers. The numbers in the array can be stored in
any ordinal variant type (signed or unsigned integers from 8 to 32 bits).
Encoding
A string that defines how numbers in the array should be mapped to
character codes:
"Unicode" = The numbers represent Unicode code points with values
ranging from 0x0000 to 0x10FFFD.
"UTF-8" = The numbers represent the bytes of Unicode code points
encoded using the variable-length UTF-8 encoding scheme with values
ranging from 0 to 244.
"UTF-16" = The numbers represent the 16-bit values of Unicode code
points encoded using the variable-length UTF-16 encoding scheme with
values ranging from 0 to 65533. Unicode values from U+010000 to
U+10FFFD are represented by a surrogate pair consisting of a sequence
of two numbers.
"UTF-16LE" = The numbers represent the bytes of the UTF-16 encoding
scheme stored in little-endian format with values ranging from 0 to 255.
"UTF-16BE" = The numbers represent the bytes of the UTF-16 encoding
scheme stored in big-endian format with values ranging from 0 to 255.
"CP932" = The numbers represent either individual bytes or a
combination of 8-bit and 16-bit values from Microsoft code page 932 (an
extension of Shift JIS encoding). Double-byte values can be presented as
a 16-bit number or as two 8-bit numbers.
For encodings where numbers represent bytes this function will cast
signed 8-bit values to unsigned 8-bit values.
UnmatchedAction
Specifies how to handle numbers that are out of range or that map to
invalid character codes:
0 = Unmatched characters are ignored
1 = Unmatched characters are replaced with the Unicode U+FFFD
replacement character
Copyright© 2007-2024 https://loslab.com
Encrypt
Security and Signatures
Description
This function adds the specified security settings to the selected document.
The actual encryption of the document is delayed until the document is saved so this function can
be called at any time, even before further content is added to the document.
Syntax
Delphi
function TPDFlib.Encrypt(Owner, User: WideString; Strength,
Permissions: Integer): Integer;
ActiveX
Function PDFlib::Encrypt(Owner As String,
User As String, Strength As Long, Permissions As Long) As Long
DLL
int DLEncrypt(int InstanceID, wchar_t * Owner, wchar_t * User,
int Strength, int Permissions);
Parameters
Owner
The owner or master password for the document
User
The user password for the document
Strength
The strength of encryption to use:
0 = 40-bit encryption
1 = 128-bit RC4 encryption
2 = 128-bit AES encryption (requires Acrobat 7 or later)
3 = 256-bit AES encryption (requires Acrobat 9 or later)
4 = 256-bit AES encryption (requires Acrobat X or later)
Permissions A value created with the EncodePermissions function
Return values
0 The document could not be encrypted. Use the LastErrorCode function to
determine the reason for failure.
1
The document was encrypted successfully
Copyright© 2007-2024 https://loslab.com
EncryptFile
Security and Signatures
Description
Encrypts a file on disk and saves the results to a new file. The entire document does not have to be
loaded into memory so this function can be used to encrypt huge documents.
Syntax
Delphi
function TPDFlib.EncryptFile(InputFileName, OutputFileName,
Owner, User: WideString; Strength, Permissions: Integer): Integer;
ActiveX
Function PDFlib::EncryptFile( InputFileName As String,
OutputFileName As String, Owner As String, User As
String, Strength As Long, Permissions As Long) As
Long
DLL
int DLEncryptFile(int InstanceID, wchar_t * InputFileName,
wchar_t * OutputFileName, wchar_t * Owner, wchar_t * User,
int Strength, int Permissions);
Parameters
InputFileName
The name of the file to encrypt.
OutputFileName
The name of the destination file to create.
Owner
The owner password to use for the encrypted file. This is sometimes called
the "master" password or the "permissions" password. This password will
be needed to change the document.
User
The user password to use for the encrypted file. This is sometimes called
the "open" password, it will allow the user to open the document but not to
use the document in ways not permitted.
Strength
The strength of encryption to use:
0 = 40-bit RC4 encryption
1 = 128-bit RC4 encryption
2 = 128-bit AES encryption (requires Acrobat 7 or later)
3 = 256-bit AES encryption (requires Acrobat 9 or later)
4 = 256-bit AES encryption (requires Acorbat X or later)
Permissions A value created with the EncodePermissions function
Return values
0 The file could not be encrypted. Check the result of the LastErrorCode
function to determine the cause of the failure.
1
The document was encrypted successfully
Copyright© 2007-2024 https://loslab.com
EncryptWithFingerprint
Security and Signatures
Description
Encrypts the selected document using the encryption "fingerprint" obtained from another document
using the GetEncryptionFingerprint function. The selected document will be encrypted with the
same owner and user passwords as the document the fingerprint was taken from.
Syntax
Delphi
function TPDFlib.EncryptWithFingerprint(
Fingerprint: WideString): Integer;
ActiveX
Function PDFlib::EncryptWithFingerprint(
Fingerprint As String) As Long
DLL
int DLEncryptWithFingerprint(int InstanceID, wchar_t * Fingerprint);
Parameters
Fingerprint A fingerprint returned by the GetEncryptionFingerprint function
Return values
0
The fingerprint was invalid or the document was already encrypted
1
The document was successfully encrypted using the supplied fingerprint
Copyright© 2007-2024 https://loslab.com
EncryptionAlgorithm
Document properties, Security and Signatures
Description
Returns the encryption algorithm used to encrypt the selected document.
The EncryptionStrength function can be used to determine the encryption key length.
Syntax
Delphi
function TPDFlib.EncryptionAlgorithm: Integer;
ActiveX
Function PDFlib::EncryptionAlgorithm As Long
DLL
int DLEncryptionAlgorithm(int InstanceID);
Return values
0
The document is not encrypted
1
The document is encrypted using RC4 encryption
2
The document is encrypted using AES encryption
Copyright© 2007-2024 https://loslab.com
EncryptionStatus
Document properties, Security and Signatures
Description
Determines the encryption status of the selected document.
Syntax
Delphi
function TPDFlib.EncryptionStatus: Integer;
ActiveX
Function PDFlib::EncryptionStatus As Long
DLL
int DLEncryptionStatus(int InstanceID);
Return values
0
The selected document is not encrypted
1
The document is encrypted with Adobe "Standard" encryption
2
The document is encrypted with an unknown encryption
Copyright© 2007-2024 https://loslab.com
EncryptionStrength
Document properties, Security and Signatures
Description
If the selected document has been encrypted this function returns the encryption strength.
This is the length of the key used to encrypt the contents of the document.
Syntax
Delphi
function TPDFlib.EncryptionStrength: Integer;
ActiveX
Function PDFlib::EncryptionStrength As Long
DLL
int DLEncryptionStrength(int InstanceID);
Return values
0
The selected document is not encrypted
40
The document has been encrypted with 40-bit encryption (Adobe Acrobat 3.x and
4.x)
128
The document has been encrypted with 128-bit encryption (Adobe Acrobat 5.x)
256
The document has been encrypted with 256-bit encryption (Acrobat 9 or Acrobat
10). Use the SecurityInfo function to determine which version of encryption was
used.
Copyright© 2007-2024 https://loslab.com
EndPageUpdate
Page layout
Description
For detailed page layouts the BeginPageUpdate function can be called before a group of drawing
commands. The page layout commands will then be buffered until a matching call to this function.
Syntax
Delphi
function TPDFlib.EndPageUpdate: Integer;
ActiveX
Function PDFlib::EndPageUpdate As Long
DLL
int DLEndPageUpdate(int InstanceID);
Copyright© 2007-2024 https://loslab.com
EndSignProcessToFile
Security and Signatures
Description
Completes a digital signature process and writes the signed document to a file.
The result returned by EndSignProcessToFile will always be zero. To check the result of the digital
signature signing process call the GetSignProcessResult function.
Syntax
Delphi
function TPDFlib.EndSignProcessToFile(
SignProcessID: Integer; OutputFile: WideString): Integer;
ActiveX
Function PDFlib::EndSignProcessToFile(
SignProcessID As Long, OutputFile As String) As Long
DLL
int DLEndSignProcessToFile(int InstanceID, int SignProcessID,
wchar_t * OutputFile);
Parameters
SignProcessID A value returned by the NewSignProcessFromFile,
NewSignProcessFromStream or NewSignProcessFromString functions.
OutputFile
The path and name of the file to save the signed PDF to.
Copyright© 2007-2024 https://loslab.com
EndSignProcessToStream
Security and Signatures
Description
Completes a digital signature process and writes the signed document to a TStream.
The result returned by EndSignProcessToStream will always be zero. To check the result of the
digital signature signing process call the GetSignProcessResult function.
Syntax
Delphi
function TPDFlib.EndSignProcessToStream(
SignProcessID: Integer; OutputStream: TStream): Integer;
Parameters
SignProcessID A value returned by the NewSignProcessFromFile,
NewSignProcessFromStream or NewSignProcessFromString functions.
OutputStream
The TStream object to write the signed PDF to.
Copyright© 2007-2024 https://loslab.com
EndSignProcessToString
Security and Signatures
Description
Completes a digital signature process and returns the signed document as a string of 8-bit bytes.
The result returned by EndSignProcessToString will always be zero. To check the result of the
digital signature signing process call the GetSignProcessResult function.
Syntax
Delphi
function TPDFlib.EndSignProcessToString(
SignProcessID: Integer): AnsiString;
DLL
char * DLEndSignProcessToString(int InstanceID, int SignProcessID);
Parameters
SignProcessID A value returned by the NewSignProcessFromFile,
NewSignProcessFromStream or NewSignProcessFromString functions.
Copyright© 2007-2024 https://loslab.com
ExtractFilePageContentToString
Extraction, Page manipulation
Description
Retrieves the page description operators that define the layout of any page in a PDF document.
This function does not load the entire file into memory so it can be used with arbitrarily large
documents.
Syntax
Delphi function TPDFlib.ExtractFilePageContentToString(
InputFileName, Password: WideString; Page: Integer): AnsiString;
DLL
char * DLExtractFilePageContentToString(int InstanceID,
wchar_t * InputFileName, wchar_t * Password, int Page);
Parameters
InputFileName
The path and file name of the file to extract page content from.
Password
The password to use when opening the file
Page
The number of the page to extract. The first page in the document is page 1.
Copyright© 2007-2024 https://loslab.com
ExtractFilePageContentToVariant
Extraction, Page manipulation
Description
Retrieves the page description operators that define the layout of any page in a PDF document as a
variant byte array. This function does not load the entire file into memory so it can be used with
arbitrarily large documents.
Syntax
ActiveX
Function PDFlib::ExtractFilePageContentToVariant(
InputFileName As String, Password As String,
Page As Long) As Variant
Parameters
InputFileName
The path and file name of the file to extract page content from.
Password
The password to use when opening the file
Page
The number of the page to extract. The first page in the document is page 1.
Copyright© 2007-2024 https://loslab.com
ExtractFilePageText
Extraction, Page properties
Description
Extracts the text of any page in a PDF file.
This function internally uses the direct access functionality. The entire file is not loaded into
memory, so this function can be used on arbitrarily large documents.
Two different methods are provided for extracting text from the selected page in a variety of
output formats.
The DASetTextExtractionWordGap, DASetTextExtractionOptions and
DASetTextExtractionArea functions can be used to adjust the text extraction process.
Syntax
Delphi
function TPDFlib.ExtractFilePageText(InputFileName,
Password: WideString; Page, Options: Integer): WideString;
ActiveX
Function PDFlib::ExtractFilePageText(
InputFileName As String, Password As String, Page As Long,
Options As Long) As String
DLL
wchar_t * DLExtractFilePageText(int InstanceID, wchar_t * InputFileName,
wchar_t * Password, int Page, int Options);
Parameters
InputFileName
The path and file name of the file to extract text from.
Password
The password to use, if any, when opening the file
Page
The number of the page that must be extracts. The first page in the
document is page 1.
Options
Using the standard text extraction algorithm:
0 = Extract text in human readable format
1 = Deprecated
2 = Return a CSV string including font, color, size and position of each piece
of text on the page
Using the more accurate but slower text extraction algorithm:
3 = Return a CSV string for each piece of text on the page with the following
format:
Font Name, Text Color, Text Size, X1, Y1, X2, Y2, X3, Y3, X4, Y4, Text
The co-ordinates are the four points bounding the text, measured using the
units set with the SetMeasurementUnits function and the origin set with
the SetOrigin function. Co-ordinate order is anti-clockwise with the bottom
left corner first.
4 = Similar to option 3, but individual words are returned, making searching
for words easier
5 = Similar to option 3 but character widths are output after each block of
text
6 = Similar to option 4 but character widths are output after each line of text
7 = Extract text in human readable format with improved accuracy compared
to option 0
8 = Similar output format as option 0 but using the more accurate algorithm.
Returns unformatted lines.
Copyright© 2007-2024 https://loslab.com
ExtractFilePageTextBlocks
Text, Extraction, Page properties
Description
Similar to the ExtractFilePageText function but the results are stored in a text block list rather
than returned as a CSV string.
This function internally uses the direct access functionality.
Once the results are in the text block list, functions such as DAGetTextBlockCount,
DAGetTextBlockText and DAGetTextBlockColor can be used to retrieve the properties of each
block of text.
Syntax
Delphi
function TPDFlib.ExtractFilePageTextBlocks(InputFileName,
Password: WideString; Page, Options: Integer): Integer;
ActiveX
Function PDFlib::ExtractFilePageTextBlocks(
InputFileName As String, Password As String, Page As Long,
Options As Long) As Long
DLL
int DLExtractFilePageTextBlocks(int InstanceID, wchar_t * InputFileName,
wchar_t * Password, int Page, int Options);
Parameters
InputFileName
The path and file name of the file to extract text from.
Password
The password to use, if any, when opening the file
Page
The number of the page that must be extracts. The first page in the
document is page 1.
Options
3 = Normal extraction
4 = Split words
Return values
0
The text could not be extracted
1
A TextBlockListID value
Copyright© 2007-2024 https://loslab.com
ExtractFilePages
Document manipulation, Extraction, Page manipulation
Description
Extracts ranges of pages from a PDF document on disk and places the extracted pages into a new
PDF document.
The ExtractFilePagesEx
function is able to produce smaller output files using a cross reference
stream instead of a cross reference table.
Syntax
Delphi
function TPDFlib.ExtractFilePages(InputFileName, Password,
OutputFileName, RangeList: WideString): Integer;
ActiveX
Function PDFlib::ExtractFilePages(
InputFileName As String, Password As String,
OutputFileName As String, RangeList As String) As Long
DLL
int DLExtractFilePages(int InstanceID, wchar_t * InputFileName,
wchar_t * Password, wchar_t * OutputFileName,
wchar_t * RangeList);
Parameters
InputFileName
The path and name of the document that contains the pages to extract.
Password
The password to use when opening the document
OutputFileName
The path and name of the document to create containing the extracted
pages.
RangeList
The pages to extract, for example "10,15,18-20,25-35". Invalid characters
will be ignored. Reversed page ranges such as "5-1" will be accepted.
Duplicate page numbers will be accepted but if a change is made to such a
page the same changes will appear on the duplicate pages. The list of
pages will not be sorted so the resulting document will have the pages in
the specified order.
Return values
0 The pages could not be extracted. Use the LastErrorCode function to
determine the cause of the failure.
1
The pages were extracted successfully
Copyright© 2007-2024 https://loslab.com
ExtractFilePagesEx
Document manipulation, Extraction, Page manipulation
Description
Similar to the ExtractFilePages function but is able to generate smaller output files using cross
reference streams rather than a cross reference table.
Options can be logically OR'd to together to invoke multiple options.
For example Options = 3 ( 1 + 2) will Use a cross reference stream (smaller output file size)
and also Remove all AcroForm and XFA based FormFields as well as Usage Rights
Syntax
Delphi
function TPDFlib.ExtractFilePagesEx(InputFileName, Password,
OutputFileName, RangeList: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::ExtractFilePagesEx(
InputFileName As String, Password As String,
OutputFileName As String, RangeList As String, Options As
Long) As Long
DLL
int DLExtractFilePagesEx(int InstanceID, wchar_t * InputFileName,
wchar_t * Password, wchar_t * OutputFileName,
wchar_t * RangeList, int Options);
Parameters
InputFileName
The path and name of the document that contains the pages to extract.
Password
The password to use when opening the document.
OutputFileName
The path and name of the document to create containing the extracted
pages.
RangeList
The pages to extract, for example "10,15,18-20,25-35". Invalid characters
will be ignored. Reversed page ranges such as "5-1" will be accepted.
Duplicate page numbers will be accepted but if a change is made to such a
page the same changes will appear on the duplicate pages. The list of
pages will not be sorted so the resulting document will have the pages in
the specified order.
Options
0 = Use a cross reference table
1 = Use a cross reference stream (smaller output file size)
2 = Remove all AcroForm and XFA based FormFields as well as Usage
Rights
Return values
0 The pages could not be extracted. Use the LastErrorCode function to
determine the cause of the failure.
1
The pages were extracted successfully
Copyright© 2007-2024 https://loslab.com
ExtractPageRanges
Document manipulation, Extraction, Page manipulation
Description
Use this function to extract one or more non-consecutive pages from a document to a new
document.
Syntax
Delphi
function TPDFlib.ExtractPageRanges(
RangeList: WideString): Integer;
ActiveX
Function PDFlib::ExtractPageRanges(
RangeList As String) As Long
DLL
int DLExtractPageRanges(int InstanceID, wchar_t * RangeList);
Parameters
RangeList
The pages to extract, for example "10,15,18-20,25-35". Invalid characters and
duplicate page numbers in the string will be ignored. Reversed page ranges such
as "5-1" will be accepted. The list of pages will be sorted resulting in the pages
being extracted in numerical order.
Return values
0
The page extraction did not succeed. The original document remains as the
selected document.
1
The page extraction was successful. The new document containing the selected
pages is now the selected document.
Copyright© 2007-2024 https://loslab.com
ExtractPageTextBlocks
Text, Extraction
Description
Similar to the GetPageText function but the results are stored in a text block list rather than
returned as a CSV string.
Once the results are in the text block list, functions such as GetTextBlockCount,
GetTextBlockText and GetTextBlockColor can be used to retrieve the properties of each block
of text.
Syntax
Delphi
function TPDFlib.ExtractPageTextBlocks(
ExtractOptions: Integer): Integer;
ActiveX
Function PDFlib::ExtractPageTextBlocks(
ExtractOptions As Long) As Long
DLL
int DLExtractPageTextBlocks(int InstanceID, int ExtractOptions);
Parameters
ExtractOptions
3 = Normal extraction
4 = Split words
Return values
0
The text could not be extracted
Non-zero
A TextBlockListID value
Copyright© 2007-2024 https://loslab.com
ExtractPages
Extraction, Page manipulation
Description
Copies the selected document to a new document, but retains only the specified pages.
If successful, the new document will be selected and the original document will be removed from
memory.
Syntax
Delphi
function TPDFlib.ExtractPages(StartPage,
PageCount: Integer): Integer;
ActiveX
Function PDFlib::ExtractPages(StartPage As Long,
PageCount As Long) As Long
DLL
int DLExtractPages(int InstanceID, int StartPage, int PageCount);
Parameters
StartPage
The page number of the first page to extract
PageCount
The total number of pages to extract
Return values
0 Failed, use LastErrorCode for further details
1
Success
Copyright© 2007-2024 https://loslab.com
FileListCount
Miscellaneous functions
Description
Returns the number of items in the specified file list.
Syntax
Delphi
function TPDFlib.FileListCount(
ListName: WideString): Integer;
ActiveX
Function PDFlib::FileListCount(
ListName As String) As Long
DLL
int DLFileListCount(int InstanceID, wchar_t * ListName);
Parameters
ListName
The name of the file list
Copyright© 2007-2024 https://loslab.com
FileListItem
Miscellaneous functions
Description
Returns the file name stored at the specified index in the named list.
Syntax
Delphi
function TPDFlib.FileListItem(ListName: WideString;
Index: Integer): WideString;
ActiveX
Function PDFlib::FileListItem(ListName As String,
Index As Long) As String
DLL
wchar_t * DLFileListItem(int InstanceID, wchar_t * ListName, int Index);
Parameters
ListName
The name of the list to work with
Index
The index of the file name to retrieve. The first item has an index of 1.
Copyright© 2007-2024 https://loslab.com
FindFonts
Fonts, Document properties
Description
Analyses the selected document and finds all available fonts. The number of found fonts is
returned. Calling this function a second time will return zero as all relevant fonts were found the
first time the function was called. These fonts are then available in conjunction to the fonts added
with the Add*Font functions and will also be counted in subsequent calls to the FontCount
function.
Syntax
Delphi
function TPDFlib.FindFonts: Integer;
ActiveX
Function PDFlib::FindFonts As Long
DLL
int DLFindFonts(int InstanceID);
Return values
0
No fonts were found in the document
Non-zero
The number of fonts that were found
Copyright© 2007-2024 https://loslab.com
FindFormFieldByTitle
Form fields
Description
Finds the index of the form field with the specified title.
Syntax
Delphi
function TPDFlib.FindFormFieldByTitle(
Title: WideString): Integer;
ActiveX
Function PDFlib::FindFormFieldByTitle(
Title As String) As Long
DLL
int DLFindFormFieldByTitle(int InstanceID, wchar_t * Title);
Parameters
Title
The title of the form field to find.
Return values
0
The form field could not be found
Non-zero
The Index of the form field with the specified title
Copyright© 2007-2024 https://loslab.com
FindImages
Image handling, Document properties
Description
Searches the selected document for embedded images. This functions searches for image in the
Resources dictionary for the entire document. It cannot report where the image was drawn or even
if it was drawn at all.
To get the location and number of images draw for each page you will need to use the
GetPageImageList and related functions.
This function returns the number of images found.
Syntax
Delphi
function TPDFlib.FindImages: Integer;
ActiveX
Function PDFlib::FindImages As Long
DLL
int DLFindImages(int InstanceID);
Return values
0
No images were found
1-n
Number of images found
Copyright© 2007-2024 https://loslab.com
FitImage
Image handling, Page layout
Description
This function allows an image to be placed into an area on the page. The aspect ratio of the image
is preserved, and the alignment and rotation of the image can be specified.
Syntax
Delphi
function TPDFlib.FitImage(Left, Top, Width, Height: Double;
HAlign, VAlign, Rotate: Integer): Integer;
ActiveX
Function PDFlib::FitImage(Left As Double,
Top As Double, Width As Double, Height As Double,
HAlign As Long, VAlign As Long, Rotate As Long) As Long
DLL
int DLFitImage(int InstanceID, double Left, double Top, double Width,
double Height, int HAlign, int VAlign, int Rotate);
Parameters
Left
The horizontal co-ordinate of the left-edge of the bounding box
Top
The vertical co-ordinate of the top-edge of the bounding box
Width
The width of the bounding box
Height
The height of the bounding box
HAlign
Horizontal alignment of the image within the bounding box:
0 = Left
1 = Center
2 = Right
VAlign
Vertical alignment of the image within the bounding box:
0 = Top
1 = Center
2 = Bottom
Rotate
The rotation of the image:
0 = Normal
1 = 90 degrees anti-clockwise
2 = 90 degrees clockwise
3 = 180 degrees
Return values
0
The image could not be drawn. Either a valid image has not been selected or the
HAlign, VAlign or Rotate parameters are out of range.
1
The image was drawn successfully
Copyright© 2007-2024 https://loslab.com
FitRotatedTextBox
Text, Page layout
Description
Similar to the FitTextBox function, but the angle of the box can be rotated by any angle. The text
size is adjusted to ensure that all the text fits into the available space. The top-left corner of the
box before it is rotated is used as the rotation point.
Syntax
Delphi
function TPDFlib.FitRotatedTextBox(Left, Top, Width, Height,
Angle: Double; Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::FitRotatedTextBox(
Left As Double, Top As Double, Width As Double, Height As
Double, Angle As Double, Text As String, Options As Long)
As Long
DLL
int DLFitRotatedTextBox(int InstanceID, double Left, double Top,
double Width, double Height, double Angle, wchar_t * Text,
int Options);
Parameters
Left
The horizontal co-ordinate of the top-left corner of the box before it is rotated
Top
The vertical co-ordinate of the top-left corner of the box before it is rotated
Width
The width of the box before it is rotated
Height
The height of the box before it is rotated
Angle
The angle in degrees that the box should be rotated by. A positive angle rotates the
box in an anti-clockwise direction, a negative angle rotated the box in a clockwise
direction.
Text
The text that will be fitted into the box
Options
Vertical alignment:
0 = Centered
1 = Top
2 = Bottom
If 100 is added to these values long words will not be split up, the font size will be
reduced until the longest word fits into the available width.
If 1000 is addd to these values the font size will be allowed to increase until the text
fills the available area.
Return values
0
The Options parameter was out of range
1
The rotated text box was drawn successfully
Copyright© 2007-2024 https://loslab.com
FitTextBox
Text, Page layout
Description
Similar to the DrawText function, but the text size is adjusted to ensure that all the text fits into
the available space.
Syntax
Delphi
function TPDFlib.FitTextBox(Left, Top, Width,
Height: Double; Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::FitTextBox(Left As Double,
Top As Double, Width As Double, Height As Double,
Text As String, Options As Long) As Long
DLL
int DLFitTextBox(int InstanceID, double Left, double Top, double Width,
double Height, wchar_t * Text, int Options);
Parameters
Left
The horizontal co-ordinate of the left edge of the bounding box
Top
The vertical co-ordinate of the top edge of the bounding box
Width
The width of the bounding box
Height
The height of the bounding box
Text
The text to display in the box
Options
Vertical alignment:
0 = Centered
1 = Top
2 = Bottom
If 100 is added to these values long words will not be split up, the font size will be
reduced until the longest word fits into the available width.
If 1000 is addd to these values the font size will be allowed to increase until the text
fills the available area.
Return values
0
The Options specified were out of range
1
The text was drawn successfully
Copyright© 2007-2024 https://loslab.com
FlattenAnnot
Annotations and hotspot links, Page layout
Description
Flattens the specified annotation by merging the appearance stream with the selected page.
Syntax
Delphi
function TPDFlib.FlattenAnnot(Index,
Options: Integer): Integer;
ActiveX
Function PDFlib::FlattenAnnot(Index As Long,
Options As Long) As Long
DLL
int DLFlattenAnnot(int InstanceID, int Index, int Options);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Options
This parameter is reserved for future use and should always be set to zero.
Return values
0
The specified annotation could not be flattened
1
Success
Copyright© 2007-2024 https://loslab.com
FlattenFormField
Form fields, Page layout
Description
Use this function to draw the visual appearance onto the page it is associated with. The form field
will then be removed from the document and only it's appearance will remain - it will no longer be
an interactive field.
If the field is flattened successfully the field index of subsequent form fields will be decreased by 1.
This function does not updates the form field's appearance stream before flattening. To update the
appearance stream before flattening, use the UpdateAndFlattenFormField function or call
UpdateAppearanceStream followed by a call to this function.
Syntax
Delphi
function TPDFlib.FlattenFormField(Index: Integer): Integer;
ActiveX
Function PDFlib::FlattenFormField(
Index As Long) As Long
DLL
int DLFlattenFormField(int InstanceID, int Index);
Parameters
Index
The index of the form field to work with. The first form field has an index of 1.
Return values
0
The form field could not be found or it was not possible to flatten the form field
1
The form field was flattened successfully
Copyright© 2007-2024 https://loslab.com
FontCount
Fonts
Description
Returns the total number of fonts added to the PDF file. This function does not take into account
the fonts that may have already been in an existing PDF document which was loaded with the
LoadFromFile function unless the FindFonts function has been called.
Syntax
Delphi
function TPDFlib.FontCount: Integer;
ActiveX
Function PDFlib::FontCount As Long
DLL
int DLFontCount(int InstanceID);
Return values
0 No fonts have been added to the document or FindFonts has not found any fonts
in an existing document.
Non-zero
The number of fonts added to the PDF plus the number of fonts found with
FindFonts.
Copyright© 2007-2024 https://loslab.com
FontFamily
Fonts
Description
Returns the font family of the selected font, if available. Syntax
Delphi
function TPDFlib.FontFamily: WideString;
ActiveX
Function PDFlib::FontFamily As String
DLL
wchar_t * DLFontFamily(int InstanceID);
Copyright© 2007-2024 https://loslab.com
FontHasKerning
Text, Fonts
Description
Indicated whether the selected font has kerning information.
Syntax
Delphi
function TPDFlib.FontHasKerning: Integer;
ActiveX
Function PDFlib::FontHasKerning As Long
DLL
int DLFontHasKerning(int InstanceID);
Return values
0
The selected font does not have any kerning information
1
The selected font has at least one kerning pair
Copyright© 2007-2024 https://loslab.com
FontName
Fonts
Description
Returns the name of the selected font. A font is automatically selected when it is added to the
document. The GetFontID and SelectFont functions can be used to select a different font.
Syntax
Delphi
function TPDFlib.FontName: WideString;
ActiveX
Function PDFlib::FontName As String
DLL
wchar_t * DLFontName(int InstanceID);
Copyright© 2007-2024 https://loslab.com
FontReference
Fonts
Description
Returns the internal reference of the selected font.
Syntax
Delphi
function TPDFlib.FontReference: WideString;
ActiveX
Function PDFlib::FontReference As String
DLL
wchar_t * DLFontReference(int InstanceID);
Copyright© 2007-2024 https://loslab.com
FontSize
Text, Fonts
Description
Returns the size in bytes of the selected font. A value will only be returned for embedded TrueType
or Type1 fonts. A value will not be returned for subsetted fonts or standard fonts.
Syntax
Delphi
function TPDFlib.FontSize: Integer;
ActiveX
Function PDFlib::FontSize As Long
DLL
int DLFontSize(int InstanceID);
Copyright© 2007-2024 https://loslab.com
FontType
Fonts
Description
Used to determine the type of the selected font.
Syntax
Delphi
function TPDFlib.FontType: Integer;
ActiveX
Function PDFlib::FontType As Long
DLL
int DLFontType(int InstanceID);
Return values
0
No font has been selected
1
Unknown
2
Standard
3
TrueType
4
Embedded TrueType
5
Packaged
6
Type1
7
Subsetted
8
Type3
9
Type1 CID
10
TrueType CID
11
CJK
Copyright© 2007-2024 https://loslab.com
FormFieldCount
Form fields
Description
Returns the total number of form fields in the selected document. The Index parameter of the
various form field functions must be a number from 1 to the value returned by this function.
If a form field is deleted or flattened successfully it will be removed from the document, the total
field count will be reduced and the field Index of the subsequent fields will be reduced by 1.
Syntax
Delphi
function TPDFlib.FormFieldCount: Integer;
ActiveX
Function PDFlib::FormFieldCount As Long
DLL
int DLFormFieldCount(int InstanceID);
Return values
0
There are no form fields
Non-zero
The number of form fields in the document
Copyright© 2007-2024 https://loslab.com
FormFieldHasParent
Form fields
Description
This function returns 1 if the specified form field is the child of another field.
Syntax
Delphi
function TPDFlib.FormFieldHasParent(Index: Integer): Integer;
ActiveX
Function PDFlib::FormFieldHasParent(
Index As Long) As Long
DLL
int DLFormFieldHasParent(int InstanceID, int Index);
Parameters
Index
The index of the form field. The first field has an index of 1.
Copyright© 2007-2024 https://loslab.com
FormFieldJavaScriptAction
Form fields, JavaScript
Description
Adds JavaScript to a form field for any of the possible action types.
Syntax
Delphi
function TPDFlib.FormFieldJavaScriptAction(Index: Integer;
ActionType, JavaScript: WideString): Integer;
ActiveX
Function PDFlib::FormFieldJavaScriptAction(
Index As Long, ActionType As String,
JavaScript As String) As Long
DLL
int DLFormFieldJavaScriptAction(int InstanceID, int Index,
wchar_t * ActionType, wchar_t * JavaScript);
Parameters
Index
Index of the form field
ActionType
The action type:
E = An action to be performed when the cursor enters the annotation's active
area
X = An action to be performed when the cursor exits the annotation's active area
D = An action to be performed when the mouse button is pressed inside the
annotation's active area
U = An action to be performed when the mouse button is released inside the
annotation's active area
Fo = An action to be performed when the annotation receives the input focus
Bl = An action to be performed when the annotation loses the input focus
(blurred)
K = An action to be performed when the user types a keystroke into a text field
or combo box or modifies the selection in a scrollable list box. This allows the
keystroke to be checked for validity and rejected or modified.
F = An action to be performed before the field is formatted to display its current
value. This allows the field's value to be modified before formatting.
V = An action to be performed when the field's value is changed. This allows the
new value to be checked for validity.
C = An action to be performed in order to recalculate the value of this field when
that of another field changes
JavaScript
The JavaScript to execute.
Return values
0
Cannot find the form field
1
The JavaScript action was added to the form field successfully
Copyright© 2007-2024 https://loslab.com
FormFieldWebLinkAction
Form fields
Description
Adds an action to the specified form field that links to an internet address.
Syntax
Delphi
function TPDFlib.FormFieldWebLinkAction(Index: Integer;
ActionType, Link: WideString): Integer;
ActiveX
Function PDFlib::FormFieldWebLinkAction(
Index As Long, ActionType As String, Link As String) As Long
DLL
int DLFormFieldWebLinkAction(int InstanceID, int Index,
wchar_t * ActionType, wchar_t * Link);
Parameters
Index
The index of the form field to set the action of
ActionType
The action type:
E = An action to be performed when the cursor enters the annotation's active
area
X = An action to be performed when the cursor exits the annotation's active area
D = An action to be performed when the mouse button is pressed inside the
annotation's active area
U = An action to be performed when the mouse button is released inside the
annotation's active area
Fo = An action to be performed when the annotation receives the input focus
Bl = An action to be performed when the annotation loses the input focus
(blurred)
K = An action to be performed when the user types a keystroke into a text field
or combo box or modifies the selection in a scrollable list box. This allows the
keystroke to be checked for validity and rejected or modified.
F = An action to be performed before the field is formatted to display its current
value. This allows the field's value to be modified before formatting.
V = An action to be performed when the field's value is changed. This allows the
new value to be checked for validity.
C = An action to be performed in order to recalculate the value of this field when
that of another field changes
Link
The URL to link to. Some examples:
"http://www.example.com"
Return values
0
The form field could not be found, or the ActionType was invalid
1
The web link action was added to the form field successfully
Copyright© 2007-2024 https://loslab.com
GetActionDest
Annotations and hotspot links
Description
This function will return a DestID if the specified action has a destination entry.
The DestID can be used with the GetDestPage, GetDestType and GetDestValue functions.
Syntax
Delphi
function TPDFlib.GetActionDest(ActionID: Integer): Integer;
ActiveX
Function PDFlib::GetActionDest(
ActionID As Long) As Long
DLL
int DLGetActionDest(int InstanceID, int ActionID);
Parameters
ActionID An ActionID as returned by the GetAnnotActionID, GetOutlineActionID or
GetFormFieldActionID functions
Return values
0
The specified action does not have a destination entry
Non-zero
A DestID that can be used with the destination functions.
Copyright© 2007-2024 https://loslab.com
GetActionType
Annotations and hotspot links
Description
Returns the action type of the specified action, for example "GoTo" or "GoToR".
Syntax
Delphi
function TPDFlib.GetActionType(
ActionID: Integer): WideString;
ActiveX
Function PDFlib::GetActionType(
ActionID As Long) As String
DLL
wchar_t * DLGetActionType(int InstanceID, int ActionID);
Parameters
ActionID An ActionID as returned by the GetAnnotActionID, GetOutlineActionID or
GetFormFieldActionID functions
Copyright© 2007-2024 https://loslab.com
GetActionURL
Annotations and hotspot links
Description
Returns the target URL of the specified action.
Syntax
Delphi
function TPDFlib.GetActionURL(ActionID: Integer): WideString;
ActiveX
Function PDFlib::GetActionURL(
ActionID As Long) As String
DLL
wchar_t * DLGetActionURL(int InstanceID, int ActionID);
Parameters
ActionID An ActionID as returned by the GetAnnotActionID, GetOutlineActionID or
GetFormFieldActionID functions
Copyright© 2007-2024 https://loslab.com
GetAnalysisInfo
Document properties
Description
Returns individual items from the results of the analysis done by the AnalyseFile function.
Syntax
Delphi
function TPDFlib.GetAnalysisInfo(AnalysisID,
AnalysisItem: Integer): WideString;
ActiveX
Function PDFlib::GetAnalysisInfo(
AnalysisID As Long, AnalysisItem As Long) As String
DLL
wchar_t * DLGetAnalysisInfo(int InstanceID, int AnalysisID,
int AnalysisItem);
Parameters
AnalysisID The ID of the set of analysis results to query, as returned by the AnalyseFile
function
AnalysisItem
The specific analysis result to retrieve:
0 = File name (eg. ".\hello.pdf")
1 = File size (eg. "2048" for a file exactly 2K in size)
2 = Author
3 = Title
4 = Subject
5 = Keywords
6 = Creator
7 = Producer
8 = PDF version (eg. "1.4")
9 = Page count (eg. "120")
10 = Creation date
11 = Modification date
12 = Document ID
13 = The supplied password:
"None" for no security
"User" for the user password
"Owner" for the owner password
14 = Document contains usage rights (eg. Reader Extensions)
"No" if there is no usage rights dictionary
"Yes" if there is a usage rights dictionary
15 = Name of signature in the usage rights dictionary
20..30 = Equivalent to SecurityInfo(0)..SecurityInfo(10)
31 = Number of form fields in the document
41..43 = Equivalent to SecurityInfo(11)..SecurityInfo(13)
Copyright© 2007-2024 https://loslab.com
GetAnnotActionID
Annotations and hotspot links
Description
This function will return an ActionID if the specified annotation has an action dictionary.
The ActionID can be used with the GetActionType and GetActionDest functions and can also be
compared to the values returned by GetOutlineActionID to determine if an annotation action is
shared with an outline action.
Syntax
Delphi
function TPDFlib.GetAnnotActionID(Index: Integer): Integer;
ActiveX
Function PDFlib::GetAnnotActionID(
Index As Long) As Long
DLL
int DLGetAnnotActionID(int InstanceID, int Index);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Copyright© 2007-2024 https://loslab.com
GetAnnotDblProperty
Annotations and hotspot links
Description
Returns a property of the specified annotation.
Syntax
Delphi
function TPDFlib.GetAnnotDblProperty(Index,
Tag: Integer): Double;
ActiveX
Function PDFlib::GetAnnotDblProperty(
Index As Long, Tag As Long) As Double
DLL
double DLGetAnnotDblProperty(int InstanceID, int Index, int Tag);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Tag
105 = Left
106 = Top
107 = Width
108 = Height
119 = Gray color component
120 = Red color component
121 = Green color component
122 = Blue color component
123 = Cyan color component
124 = Magenta color component
125 = Yellow color component
126 = Black color component
132 = Border width
Copyright© 2007-2024 https://loslab.com
GetAnnotDest
Annotations and hotspot links
Description
This function will return a DestID if the specified annotation has a destination entry.
The DestID can be used with the GetDestPage, GetDestType and GetDestValue functions.
If the annotation does not have a destination entry, this function will return zero.
The GetAnnotActionID function might return a value that can be used with theGetActionDest
function.
Syntax
Delphi
function TPDFlib.GetAnnotDest(Index: Integer): Integer;
ActiveX
Function PDFlib::GetAnnotDest(
Index As Long) As Long
DLL
int DLGetAnnotDest(int InstanceID, int Index);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Return values
0
The specified annotation does not have a destination entry.
Non-zero
A DestID that can be used with the destination functions.
Copyright© 2007-2024 https://loslab.com
GetAnnotEmbeddedFileName
Annotations and hotspot links
Description
Returns the filename of the embedded attachment that is stored in this annotation object
Syntax
Delphi
function TPDFlib.GetAnnotEmbeddedFileName(Index,
Options: Integer): WideString;
ActiveX
Function PDFlib::GetAnnotEmbeddedFileName(
Index As Long, Options As Long) As String
DLL
wchar_t * DLGetAnnotEmbeddedFileName(int InstanceID, int Index,
int Options);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Options
Currently not used. Default = 0
Copyright© 2007-2024 https://loslab.com
GetAnnotEmbeddedFileToFile
Annotations and hotspot links
Description
Saves the embedded file inside the annotation object to the specified file on disk.
Syntax
Delphi
function TPDFlib.GetAnnotEmbeddedFileToFile(Index,
Options: Integer; FileName: WideString): Integer;
ActiveX
Function PDFlib::GetAnnotEmbeddedFileToFile(
Index As Long, Options As Long, FileName As String) As Long
DLL
int DLGetAnnotEmbeddedFileToFile(int InstanceID, int Index, int Options,
wchar_t * FileName);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Options
Currently not used. Default = 0
FileName
The filename of where to save the file
Copyright© 2007-2024 https://loslab.com
GetAnnotEmbeddedFileToString
Annotations and hotspot links
Description
Returns the embedded file inside the annotation object as a string.
Syntax
Delphi
function TPDFlib.GetAnnotEmbeddedFileToString(Index,
Options: Integer): AnsiString;
DLL
char * DLGetAnnotEmbeddedFileToString(int InstanceID, int Index,
int Options);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Options
Currently not used. Default = 0
Copyright© 2007-2024 https://loslab.com
GetAnnotIntProperty
Annotations and hotspot links
Description
Returns a property of the specified annotation.
Syntax
Delphi
function TPDFlib.GetAnnotIntProperty(Index,
Tag: Integer): Integer;
ActiveX
Function PDFlib::GetAnnotIntProperty(
Index As Long, Tag As Long) As Long
DLL
int DLGetAnnotIntProperty(int InstanceID, int Index, int Tag);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Tag
109 = Flags
116 = Page number of "GoToR" action (1 is first page)
128 = Index of the annotation that this annotation is in reply to
131 = Page number of "GoTo" action
133 = Returns 1 if a "Launch" or "GoToR" action's NewWindow property is set
Copyright© 2007-2024 https://loslab.com
GetAnnotQuadCount
Annotations and hotspot links
Description
Returns the number of quads (rectangular areas) within the specified annotation.
Syntax
Delphi
function TPDFlib.GetAnnotQuadCount(Index: Integer): Integer;
ActiveX
Function PDFlib::GetAnnotQuadCount(
Index As Long) As Long
DLL
int DLGetAnnotQuadCount(int InstanceID, int Index);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Copyright© 2007-2024 https://loslab.com
GetAnnotQuadPoints
Annotations and hotspot links
Description
Returns a component of the specified quad (rectangular area) contained within the specified
annotation.
Syntax
Delphi
function TPDFlib.GetAnnotQuadPoints(Index, QuadNumber,
PointNumber: Integer): Double;
ActiveX
Function PDFlib::GetAnnotQuadPoints(
Index As Long, QuadNumber As Long,
PointNumber As Long) As Double
DLL
double DLGetAnnotQuadPoints(int InstanceID, int Index, int QuadNumber,
int PointNumber);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of
1.
QuadNumber
The number of the quad to access. The first quad has a QuadNumber of 1.
PointNumber
1 = The horizontal co-ordinate of the bottom-left corner
2 = The vertical co-ordinate of the bottom-left corner
3 = The horizontal co-ordinate of the bottom-right corner
4 = The vertical co-ordinate of the bottom-right corner
5 = The horizontal co-ordinate of the top-right corner
6 = The vertical co-ordinate of the top-right corner
7 = The horizontal co-ordinate of the top-left corner
8 = The vertical co-ordinate of the top-left corner
Copyright© 2007-2024 https://loslab.com
GetAnnotSoundToFile
Annotations and hotspot links
Description
Copies the sound data stored in the specified annotation into a file.
Syntax
Delphi
function TPDFlib.GetAnnotSoundToFile(Index,
Options: Integer; SoundFileName: WideString): Integer;
ActiveX
Function PDFlib::GetAnnotSoundToFile(
Index As Long, Options As Long,
SoundFileName As String) As Long
DLL
int DLGetAnnotSoundToFile(int InstanceID, int Index, int Options,
wchar_t * SoundFileName);
Parameters
Index
The index of the annotation. The first annotation on the page has an index
of 1.
Options
0 = Sound data as stored in the PDF
1 = Encode data as a WAV file
SoundFileName
The path and name of the file to create containing the sound data.
Return values
0
The sound could not be written
1
The sound was written successfully
Copyright© 2007-2024 https://loslab.com
GetAnnotSoundToString
Annotations and hotspot links
Description
Returns the sound data stored in the specified annotation.
Syntax
Delphi
function TPDFlib.GetAnnotSoundToString(Index,
Options: Integer): AnsiString;
DLL
char * DLGetAnnotSoundToString(int InstanceID, int Index, int Options);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Options
0 = Sound data as stored in the PDF
1 = Encode data as a WAV file
Copyright© 2007-2024 https://loslab.com
GetAnnotStrProperty
Annotations and hotspot links
Description
Returns a property of the specified annotation.
Syntax
Delphi
function TPDFlib.GetAnnotStrProperty(Index,
Tag: Integer): WideString;
ActiveX
Function PDFlib::GetAnnotStrProperty(
Index As Long, Tag As Long) As String
DLL
wchar_t * DLGetAnnotStrProperty(int InstanceID, int Index, int Tag);
Parameters
Index
The index of the annotation. The first annotation on the page has an index of 1.
Tag
101 = Annotation type
102 = Contents
103 = Name
104 = Modified date
110 = Author
111 = URL of a link annotation
112 = Action type of link annotation, eg. "URI", "Launch", "GoToR"
113 = The "Win" file name of a "Launch" action
114 = The "F" file name of a "Launch" action
115 = The "F" file name of a "GoToR" action
117 = The name of the annotation icon
118 = Color space, eg. "Gray", "RGB", "CMYK"
127 = Subject of the annotation
129 = The "UF" file name of a "Launch" action
130 = The "UF" file name of a "GoToR" action
140 = The "OverlayText" of the Radact annotation object
Copyright© 2007-2024 https://loslab.com
GetBarcodeWidth
Vector graphics, Page layout
Description
Returns the total width of a barcode based on the width of the smallest bars in the barcode.
Syntax
Delphi
function TPDFlib.GetBarcodeWidth(NominalWidth: Double;
Text: WideString; Barcode: Integer): Double;
ActiveX
Function PDFlib::GetBarcodeWidth(
NominalWidth As Double, Text As String,
Barcode As Long) As Double
DLL
double DLGetBarcodeWidth(int InstanceID, double NominalWidth,
wchar_t * Text, int Barcode);
Parameters
NominalWidth
The desired width of the narrowest bars in the barcode
Text
The barcode data
Barcode
1 = Code39 (or Code 3 of 9)
2 = EAN-13
3 = Code128
4 = PostNet
5 = Interleaved 2 of 5
Copyright© 2007-2024 https://loslab.com
GetBaseURL
Document properties, Annotations and hotspot links
Description
Returns the Base URL for all URL links in the document.
For example, if the Base URL was set to "http://www.example.com/" and a URL link destination
was set to "index.html" then the link will point to "http://www.example.com/index.html".
Use the AddLinkToWeb function to add a URL link to the current page.
Syntax
Delphi
function TPDFlib.GetBaseURL: WideString;
ActiveX
Function PDFlib::GetBaseURL As String
DLL
wchar_t * DLGetBaseURL(int InstanceID);
Copyright© 2007-2024 https://loslab.com
GetCSDictEPSG
Measurement and coordinate units
Description
Returns the EPSG reference code for a coordinate system dictionary (see www.epsg.org).
Syntax
Delphi
function TPDFlib.GetCSDictEPSG(CSDictID: Integer): Integer;
ActiveX
Function PDFlib::GetCSDictEPSG(
CSDictID As Long) As Long
DLL
int DLGetCSDictEPSG(int InstanceID, int CSDictID);
Parameters
CSDictID A value returned from the GetMeasureDictGCSDict or GetMeasureDictDCSDict
functions
Copyright© 2007-2024 https://loslab.com
GetCSDictType
Measurement and coordinate units
Description
Returns the coordinate system type for a coordinate system dictionary.
Syntax
Delphi
function TPDFlib.GetCSDictType(CSDictID: Integer): Integer;
ActiveX
Function PDFlib::GetCSDictType(
CSDictID As Long) As Long
DLL
int DLGetCSDictType(int InstanceID, int CSDictID);
Parameters
CSDictID A value returned from the GetMeasureDictGCSDict or GetMeasureDictDCSDict
functions
Return values
0
The CSDictID parameter was incorrect
1
A geographic coordinate system (GEOGCS)
2
A projected coordinate system (PROJCS)
Copyright© 2007-2024 https://loslab.com
GetCSDictWKT
Measurement and coordinate units
Description
Returns the Well Known Text (WKT) description of a coordinate system dictionary.
Syntax
Delphi
function TPDFlib.GetCSDictWKT(CSDictID: Integer): WideString;
ActiveX
Function PDFlib::GetCSDictWKT(CSDictID As Long) As String
DLL
wchar_t * DLGetCSDictWKT(int InstanceID, int CSDictID);
Parameters
CSDictID A