Description
Gets a PDFContent object from a page (a PDFPage object).
Applies to
Syntax
PDFContent GetContent(long index)
PDFContent GetContent(string name)
Argument |
Description |
---|---|
name |
The name of the PDFContent object. |
index | The index of the PDFContent object. |
Return value
PDFContent object. Returns the object if it succeeds, or null if the object cannot be found.
Usage
Call the function to get a PDFContent object from the PDFPage object. You may either specify the object name or the index of the object in the page. The PDFContent object may be 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).
The index of the PDFContent objects in a PDFPage is determined by the orders they are added into the PDFPage. The first one added has the index 1, the second has the index 2, and so on. If one object is removed, the indexes for the remaining objects will be reordered.
Examples
The following example shows how to get the PDFContent object with the specified name or index:
PDFtext lpdf_text1 //Get the PDFContent object with name=text lpdf_text.name = "text" lpdf_text1 = lpdf_page.getcontent("text") //Get the PDFContent object with index=1 lpdf_text1 = lpdf_page.getcontent(1)
See also