Search Results for

    Show / Hide Table of Contents

    Class TextExtractionOrder

    Strategy for determining word order when extracting text from PDFs. Controls how text is read from complex layouts like columns, tables, or edited documents.

    // Extract from multi-column newsletter:
    string columns = pdf.ExtractAllText(TextExtractionOrder.LogicalOrder);
    // Reads: Column 1 top to bottom, then Column 2 top to bottom
    
    // Extract from heavily edited document:
    string visual = pdf.ExtractAllText(TextExtractionOrder.VisualOrder);
    // Reads: Left to right, top to bottom as displayed
    
    // Choose based on document type:
    var order = pdf.PageCount > 50
        ? TextExtractionOrder.LogicalOrder  // Books, reports
        : TextExtractionOrder.VisualOrder;  // Forms, invoices
    string text = pdf.ExtractAllText(order);

    See: https://ironpdf.com/how-to/extract-text/

    Inheritance
    System.Object
    TextExtractionOrder
    Namespace: IronPdf
    Assembly: IronPdf.dll
    Syntax
    public sealed class TextExtractionOrder : Enum

    The TextExtractionOrder enumeration in IronPDF picks the strategy used to determine word order when ExtractAllText or ExtractTextFromPage reads content from a PDF.

    It belongs to the IronPdf namespace and exposes two values: LogicalOrder (follows the PDF's underlying text stream, best for reading-order extraction) and VisualOrder (sorts tokens by on-page coordinates, best for multi-column layouts).

    See Extract Text & Images for both modes in use.

    Fields

    LogicalOrder

    Text extracted in original drawing order, preserving document structure. Best for newspapers, books, or multi-column layouts.

    // Use for complex layouts with columns:
    pdf.ExtractAllText(TextExtractionOrder.LogicalOrder);
    Declaration
    public const TextExtractionOrder LogicalOrder
    Field Value
    Type Description
    TextExtractionOrder
    Remarks

    Maintains reading flow as author intended

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32

    VisualOrder

    Text extracted as it appears visually: left-to-right, top-to-bottom. Best for forms, invoices, or documents edited after creation.

    // Use for simple layouts or edited PDFs:
    pdf.ExtractAllText(TextExtractionOrder.VisualOrder);
    Declaration
    public const TextExtractionOrder VisualOrder
    Field Value
    Type Description
    TextExtractionOrder
    Remarks

    Ignores original drawing order, focuses on visual position

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget