DynaPDF Manual - Page 522
Previous Page 521 Index Next Page 523
Function Reference
Page 522 of 839
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);
Example 2:
PDF files can be merged as follows:
pdfOpenImportFile(pdf, "c:/test1.pdf");
SI32 nextPage;
// We avoid the conversion of pages to templates in this case.
pdfSetImportFlags(ifImportAll | ifImportAsPage);
nextPage = pdfImportPDFFile(pdf, 1, 1.0, 1.0); // Start import at page one
// The previous PDF file will be automatically closed.
pdfOpenImportFile(pdf, "c:/test2.pdf");
// Add the new file behind the previous one.
pdfImportPDFFile(pdf, nextPage + 1, 1, 1);
pdfCloseImportFile(pdf);
Imported pages are converted to templates by default. This conversion is done by default mainly to
achieve the same runtime behaviour in comparison to older versions of DynaPDF and to enable
Previous topic: Calling the function inside of an open page, Calling the function outside of an open page
Next topic: InitBarcode2