Description
Removes a PDFContent object from a page (a PDFPage object).
Applies to
Syntax
long RemoveContent(PDFContent content)
long RemoveContent(long index)
Argument |
Description |
---|---|
Content |
The name of the PDFContent object to be removed. |
index | The index of the PDFContent object to be removed. |
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 remove 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 removes a PDFContent object in the PDFPage.
//Remove the PDFContent object with index=1 (the first PDFContent object) lpdf_page.removecontent(1) //Remove the PDFContent object with the specified name (lpdf_text) lpdf_page.removecontent(lpdf_text)
See also