Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 468

Previous Page 467   Index   Next Page 469

Function Reference
Page 468 of 750
Calling the function outside of an open page
If the function is called outside of an open page, no interactive objects are imported and the scaling
factors ScaleX and ScaleY are ignored. The page becomes converted to a template. The function works
then exactly like ImportPage(). The resulting template can be placed on one or more pages with
PlaceTemplate() or better PlaceTemplateEx(). The latter version is preferred because it considers the
coordinate origin of the template as well as a maybe existing crop box and it preserves the original
page orientation.
Remarks:
This function is available in an Ansi and Unicode compatible version.
Return values:
If the function succeeds and if the imported page was converted to a template, the return value is a
template handle, a value greater or equal zero.
If the imported page was not converted to a template and if the function succeeds, the return value is
zero. If the function fails the return value is a negative error code.
ImportPDFFile
Syntax:
SI32 pdfImportPDFFile(
const PPDF* IPDF, // Instance pointer
UI32 DestPage,
// Add the new pages at this position
double ScaleX,
// Horizontal scaling factor (1.0 = no scaling)
double ScaleY)
// Vertical scaling factor (1.0 = no scaling)
The function imports an external PDF file including interactive objects such as annotations,
bookmarks, form fields, and so on. DynaPDF supports a large set of flags to enable import of
required objects only. Unwanted objects can be removed by the function if necessary. The import
flags are described in detail at SetImportFlags() and SetImportFlags2().
The parameter DestPage specifies the destination page on which the new pages will be inserted or
added if the pages already exist. It is possible to import multiple PDF files on the same or
overlapping destination page.
Example 1:
pdfOpenImportFile(pdf, "c:/test1.pdf");
pdfImportPDFFile(pdf, 1, 1.0, 1.0); // Start import at page one
// The previous PDF file will be closed automatically.
pdfOpenImportFile(pdf, "c:/test2.pdf");
// No we have overlapping pages. For instance, if both PDF files
// contain 3 pages, then we get 3 pages in which the pages of the second
// PDF file are placed on top of the already existing ones.
pdfImportPDFFile(pdf, 1, 1.0, 1.0);
pdfCloseImportFile(pdf);
 

Previous topic: Calling the function inside of an open page

Next topic: InitColorManagement