ParserGetTextAreas Method
Extracts text areas from the document.

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

Return Value

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

The following example shows how to extract all text areas from the whole document:

// Create an instance of Parser class
using(Parser parser = new Parser(filePath))
    // Extract text areas
    IEnumerable<PageTextArea> areas = parser.GetTextAreas();
    // 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