ImportPDF
PowerScript function
Description
Imports the content of a PDF document to the PDF document.
Applies to
PDFDocument object in Objects and Controls
Syntax
|
1 |
long ImportPDF(string fileName) |
|
1 |
long ImportPDF(string fileName, long targetIndex) |
|
1 |
long ImportPDF(string fileName, string masterPassword) |
|
1 |
long ImportPDF(string fileName, long targetIndex, string masterPassword) |
|
1 |
long ImportPDF(string fileName, long startSourceIndex, long endSourceIndex, long targetIndex) |
|
1 |
long ImportPDF(string fileName, long startSourceIndex, long endSourceIndex, long targetIndex, string masterPassword) |
|
Argument |
Description |
|---|---|
|
fileName |
The name of the PDF document to be imported. |
| targetIndex | The page index at which to insert the PDF document. If not specified, the content will be inserted to the end of the document. |
| masterPassword | If required, the master password required by the PDF document that will be imported. |
| startSourceIndex | The page index from which to start the import the content of the PDF document. |
| endSourceIndex | The ending page at which to end the import of the content of the PDF document. |
Return value
Long. Returns 1 if it succeeds and -1 if it fails. For more errors,
see the Error Codes.
Usage
Call the function to import the content of the specified PDF
document (source document) to the current PDF document (target
document).
Note
-
The source document and target document must follow the same
standard (for example, “PDF_None!”). Otherwise, the imported PDF
will show as blank pages. -
After importing a PDF document with form fields (such as
checkbox, combobox, listbox, radiobutton, signature, and
textfield) into a target document, it is not possible to import
another PDF document that also contains form fields. The function
will throw an error.
Examples
The following example inserts the PDF file content to the end of the
document:
|
1 2 3 4 5 6 |
PDFdocument lpdf_doc lpdf_doc = create PDFdocument //Import the PDF content lpdf_doc.importpdf("D:import estdocument.pdf") lpdf_doc.save( "D:saveimportcomplete.pdf") |
See also