ImportContent

Description

Imports certain page in the specified PDF document into the current PDFPage object.

Applies to

PDFPage object

Syntax

long ImportContent(string pdfFileName, long pageIndex, double x, double y, double width, double height)
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 content.

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\noannotsPwd.pdf" file to the current PDF document.

PDFpage lpdf_page
PDFdocument lpdf_doc

lpdf_page = create PDFpage
lpdf_doc = create PDFdocument

lpdf_page.importcontent( "D:\import\noannotsPwd.pdf", 2, 10, 10, 500, 500)

lpdf_doc.addpage(lpdf_page)
lpdf_doc.save("D:\save\importcontent.pdf")

See also

AddContent

Clone

GetContent

GetContentCount

GetHeight

GetWidth

IndexOf

RemoveContent

SetHeight

SetPageSize

SetWidth