Description
Adds content to a page (a PDFPage object).
Applies to
Syntax
long AddContent(PDFContent content)
Return value
Long. Returns 1 if it succeeds, or -1 if an error occurs. For more errors, see the Error Codes.
Usage
Call the function to assign a PDFContent object, or an object that is derived from it (including PDFContent object, PDFInvisibleContent object, PDFVisibleContent object, PDFImage object, PDFImportContent object, PDFMultilineText object, PDFRichText object, PDFSharedText object, and PDFText object), to a PDFPage object.
Examples
The following example adds a PDFText object to the newly-created page:
PDFpage lpdf_page PDFdocument lpdf_doc PDFtext lpdf_text lpdf_page = create PDFpage lpdf_doc = create PDFdocument lpdf_text = create PDFtext lpdf_text.content = "text content" lpdf_page.addcontent(lpdf_text) lpdf_doc.addpage(lpdf_page) lpdf_doc.save("D:\addcontent.pdf")
The following example adds a PDFImportContent object to the newly-created page:
PDFdocument lpdf_doc PDFpage lpdf_page PDFimportcontent lpdf_import,lpdf_importclone lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_import = create pdfimportcontent lpdf_import.filename = "D:\import/noannots.pdf" lpdf_import.sourceindex = 1 lpdf_import.setsize( 500,500) //lpdf_importclone = lpdf_import.clone( ) lpdf_page.addcontent( lpdf_import) lpdf_doc.addpage( lpdf_page) lpdf_doc.save( "D:\save\pdfimportcontent.pdf")
See also