Parser class

Parser class

Represents the main class that controls text, images, container extraction and parsing functionality.

The Parser type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the Parser class to extract data from a URI.
init Initializes a new Parser instance to extract data from a URI with the specified load options.
init Initializes a new Parser to extract data from a URI using the specified parser settings.
init Initializes a new instance of the Parser class to extract data from a URI with the specified load options and parser settings.
init Initializes a new Parser instance to extract data from a database.
init Initializes a new Parser instance to extract data from a database.
init Initializes a new Parser instance to extract data from a remote email server.
init Initializes a new Parser to extract data from a remote email server.
init Initializes a new instance of the Parser class.
init Initializes a new Parser with the specified file path and load options.
init Initializes a new instance of the Parser class with ParserSettings.
init Initializes a new Parser instance with the specified file path, optional load options, and parser settings.
init Initializes a new Parser instance.
init Initializes a new Parser instance with the specified load options.
init Initializes a new instance of the Parser class with ParserSettings.
init Initializes a new Parser instance with the given document stream, load options, and parser settings.

Methods

Method Description
dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
generate_adjustment_fields Generates fields for automatic adjustment of template position and scale.
generate_adjustment_fields_adjustment_fields_options
generate_preview Generates pages preview.
generate_preview_preview_options
get_annotations Extracts annotations from the document.
get_annotations Extracts annotations from the document page.
get_annotations_int32
get_barcodes Extracts barcodes from the document.
get_barcodes Extracts barcodes from the document page.
get_barcodes Extracts barcodes from the document using customization options (to set the rectangular area that contains barcodes).
get_barcodes Extracts barcodes from the document using customization options.
get_barcodes Extracts barcodes from a document page using customization options to set the rectangular area that contains barcodes.
get_barcodes Extracts barcodes from the document page using customization options.
get_barcodes_barcode_options
get_barcodes_int32
get_barcodes_page_area_options
get_container Extracts a container object from the document to work with formats that contain attachments, ZIP archives, etc.
get_document_info Returns the general information about the document.
get_file_info Returns the general information about a file.
get_file_info Returns the general information about a file.
get_file_info Returns the general information about a file.
get_file_info Returns the general information about a file.
get_file_info_file
get_file_info_stream
get_file_info_streams
get_file_info_string
get_formatted_text Extracts formatted text from the document.
get_formatted_text Extracts formatted text from a document page.
get_formatted_text_formatted_text_options
get_formatted_text_int32
get_highlight Extracts a highlight from the document.
get_highlight_int32
get_hyperlinks Extracts hyperlinks from the document.
get_hyperlinks Extracts hyperlinks from the document page.
get_hyperlinks Extracts hyperlinks from the document using customization options (to set the rectangular area that contains hyperlinks).
get_hyperlinks Extracts hyperlinks from the document page using customization options to set the rectangular area that contains hyperlinks.
get_hyperlinks_int32
get_hyperlinks_page_area_options
get_images Extracts images from the document.
get_images Extracts images from the document using customization options (to set the rectangular area that contains images).
get_images Extracts images from the document page.
get_images Extracts images from the document page using customization options (to set the rectangular area that contains images).
get_images_int32
get_images_page_area_options
get_metadata Extracts metadata from the document.
get_page_preview Generates a document page preview.
get_page_preview Generates a document page preview using customization options.
get_page_preview_int32
get_structure Extracts a structured text from the document.
get_tables Extracts tables from the document.
get_tables Extracts tables from the document page.
get_tables Extracts tables from the document.
get_tables Extracts tables from the document page.
get_tables_int32
get_tables_page_table_area_options
get_text Extracts text from the document.
get_text Extracts a text page from the document using text options (to enable raw fast text extraction mode).
get_text Extracts text from a specific page of the document.
get_text Extracts text from a specific page of the document using text options (enables raw fast text extraction mode).
get_text_areas Extracts text areas from the document.
get_text_areas Extracts text areas from the document using customization options (regular expression, match case, etc.).
get_text_areas Extracts text areas from the document page.
get_text_areas Extracts text areas from the document page using customization options (regular expression, match case, etc.).
get_text_areas_int32
get_text_areas_page_text_area_options
get_text_int32
get_text_text_options
get_toc Extracts a table of contents from the document.
get_worksheet_cells Extracts worksheet cells.
get_worksheet_cells Extracts worksheet cells using customization options.
get_worksheet_cells_int32
get_worksheet_info Extracts the info about all worksheets in the spreadsheet.
get_worksheet_info Extracts the info about the worksheet.
get_worksheet_info_int32
parse_by_template Parses the document by the user-generated template.
parse_by_template Parses the document by the user-generated template using customization options.
parse_by_template Selects the most suitable template from the provided collection and then parses the document against the selected template.
parse_by_template_template
parse_by_template_template_collection
parse_form Parses the document form.
parse_pages_by_template Parses the document pages using the user-generated template.
parse_pages_by_template Parses the document pages by the user-generated template using customization options.
parse_pages_by_template_template
search Searches a keyword in the document.
search Searches a keyword in the document using search options (regular expression, match case, etc.).
search_file
search_string

Properties

Property Description
features The supported features.

Example

from groupdocs.parser import Parser

with Parser("./sample.pdf") as parser:
    text_reader = parser.get_text()
    if text_reader is not None:
        print(text_reader.read_to_end())

See Also