ParserGetTextAreas Method (PageTextAreaOptions)
Extracts text areas from the document using customization options (regular expression, match case, etc.).

Namespace: GroupDocs.Parser
Assembly: GroupDocs.Parser (in GroupDocs.Parser.dll) Version: 21.5.0
public IEnumerable<PageTextArea> GetTextAreas(
	PageTextAreaOptions options


Type: GroupDocs.Parser.OptionsPageTextAreaOptions
The options for text area extraction.

Return Value

Type: IEnumerablePageTextArea
A collection of PageTextArea objects; null if text areas extraction isn't supported.

The following example shows how to extract only text areas with digits from the upper-left courner:

// Create an instance of Parser class
using(Parser parser = new Parser(filePath))
    // Create the options which are used for text area extraction
    PageTextAreaOptions options = new PageTextAreaOptions("[0-9]+", new Rectangle(new Point(0, 0), new Size(300, 100)));

    // Extract text areas which contain only digits from the upper-left courner of a page:
    IEnumerable<PageTextArea> areas = parser.GetTextAreas(options);
    // Check if text areas extraction is supported
    if(areas == null)
        Console.WriteLine("Page text areas extraction isn't supported");

    // Iterate over page text areas
    foreach(PageTextArea a in areas)
        // Print a page index, rectangle and text area value:
        Console.WriteLine(string.Format("Page: {0}, R: {1}, Text: {2}", a.Page.Index, a.Rectangle, a.Text));
See Also