Parses the objects such as text items (characters), images, rectangles, annotations, form fields, digital signatures, hyperlinks and fonts from one or more PDF pages
options
One or more PDFParsePagesOptions enumeration member that specify the types of objects to parse.
firstPageNumber
1-based index of the first page number to parse. Must be greater than or equal to 1 and less than or equal to the number of pages in the document.
lastPageNumber
1-based index of the last page number to parse. Must be greater than or equal to firstPageNumber and less than or equal to the number of pages in the document. Use the special value of -1 to represent the last page in the document.
When a PDFDocument object is created, the pages of the PDF document are already parsed and populated in the PDFDocument.Pages collection. Each page may contain other objects such as text items (characters), images, rectangles and hyperlinks, annotations, form fields, digital signatures as well as the fonts used in these items. These items are not parsed automatically for performance reasons. Instead, you must call the ParsePages method with the page ranges you are interested in (or all pages) and type of items to parse.
Initially, the values of the PDFDocumentPage.Fonts, PDFDocumentPage.Objects, PDFDocumentPage.Hyperlinks, PDFDocumentPage.Annotations, PDFDocumentPage.FormFields and PDFDocumentPage.Signatures lists of each PDFDocumentPage will be set to null. When the ParsePages method is called, the corresponding list will be populated with the items found in the page.
You can parse any type of item you are interested in, this is done through the
If PDFParsePagesOptions.Objects is specified, then the PDFDocumentPage.Objects collection will be populated with a PDFObject object for each object item found in the page. These items can be text (characters), images or rectangles. If there are no object items found in the page, then the PDFDocumentPage.Objects will be initialized with an empty collection (PDFDocumentPage.Objects.Count will be 0).
If PDFParsePagesOptions.Hyperlinks is specified, then the PDFDocumentPage.Hyperlinks collection will be populated with a PDFHyperlink object for each hyperlink item found in the page. If no hyperlinks are found in the page, PDFDocumentPage.Hyperlinks will be initialized with an empty collection (PDFDocumentPage.Hyperlinks.Count will be 0).
If PDFParsePagesOptions.Annotations is specified, then the PDFDocumentPage.Annotations collection will be populated with a PDFAnnotation object for each annotation item found in the page. If no annotations are found in the page, PDFDocumentPage.Annotations will be initialized with an empty collection (PDFDocumentPage.Annotations.Count will be 0).
If PDFParsePagesOptions.Fonts is specified, then the PDFDocumentPage.Fonts collection will be populated with a PDFFont object for each font item found in the page. If no fonts are found in the page, PDFDocumentPage.Fonts will be initialized with an empty collection (PDFDocumentPage.Fonts.Count will be 0).
If PDFParsePagesOptions.FormFields is specified, then the PDFDocumentPage.FormFields collection will be populated with a PDFFormField object for each form field item found in the page. If no form fields are found in the page, PDFDocumentPage.FormFields will be initialized with an empty collection (PDFDocumentPage.FormFields.Count will be 0).
If PDFParsePagesOptions.Signatures is specified, then the PDFDocumentPage.Signatures collection will be populated with a PDFSignature object for each digital signature item found in the page. If no signatures are found in the page, PDFDocumentPage.Signatures will be initialized with an empty collection (PDFDocumentPage.Signatures.Count will be 0).
A white space character such as a space or a tab are parsed by default and returned as individual objects. This behavior can be stopped by OR'ing the PDFParsePagesOptions.IgnoreWhiteSpaces enumeration member with PDFParsePagesOptions.Objects in the
The values of PDFParsePagesOptions can be OR'ed together.
This example will parse all the objects from a PDF document. Refer to PDFObject for an example on how to draw the objects of a PDF page to an image and PDFTextProperties to show how to write the text of a PDF page to an external file.
Products |
Support |
Feedback: ParsePages Method - Leadtools.Pdf |
Introduction |
Help Version 19.0.2017.3.22
|