ImportContent
PowerScript function
Description
Imports certain page in the specified PDF document into the current
PDFPage object.
Applies to
PDFPage object in Objects and Controls
Syntax
|
1 |
long ImportContent(string pdfFileName, long pageIndex, double x, double y, double width, double height) |
|
1 |
long ImportContent(string pdfFileName, long pageIndex, double x, double y, double width, double height, string masterPassword) |
|
Argument |
Description |
|---|---|
|
pdfFileName |
The path name of the PDF file from which to import |
| pageIndex | The index of the page to be imported from the specified PDF file. |
| x | The x-coordinate at which to import the page in the current PDFPage object. The unit is point (pt). |
| y | The y-coordinate at which to import the page in the current PDFPage object. The unit is point (pt). |
| width | The width to be occupied by the imported page in the current PDFPage object. The unit is point (pt). |
| height | The height to be occupied by the imported page in the current PDFPage object. The unit is point (pt). |
| masterPassword | If required, the password of the PDF file to be imported. |
Return value
Long. Returns 1 if it succeeds and -1 if it fails. For more errors,
see the Error Codes.
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
This example imports the 2nd page of the “D:import
oannotsPwd.pdf”
file to the current PDF document.
|
1 2 3 4 5 6 7 8 9 10 11 |
PDFpage lpdf_page PDFdocument lpdf_doc lpdf_page = create PDFpage lpdf_doc = create PDFdocument lpdf_page.importcontent( "D:import oannotsPwd.pdf", 2, 10, 10, 500, 500) lpdf_doc.addpage(lpdf_page) lpdf_doc.save("D:saveimportcontent.pdf") |
See also