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

    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
    Want to deploy IronPDF to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronPDF free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.