PdfTextLayout Class

The text of a page with the position of its lines, words and glyphs (see PdfPage.ExtractTextLayout).

public sealed class PdfTextLayout

Remarks

By default, the lines are in the order of the content, not in a reading order: a new line starts where a glyph leaves the baseline of the previous one, goes back, or changes direction. With PdfTextReadingOrder.Layout, the lines are split at the wide gaps, grouped into blocks at the blank spaces of the page (columns, paragraphs), and ordered by their position.

Properties

NameDescription
BlocksGets the blocks of the page, in the order of PdfTextLayout.Lines: with PdfTextReadingOrder.Layout, the groups of lines the blank spaces of the page separate; otherwise, one block that has all the lines (none when the page has no text).
LinesGets the lines of the page, in the order of the content or in the reading order (PdfTextExtractionOptions.ReadingOrder).
TextGets the text of the page: the text of the lines separated by line feeds, the result of PdfPage.ExtractText.

Gets the blocks of the page, in the order of PdfTextLayout.Lines: with PdfTextReadingOrder.Layout, the groups of lines the blank spaces of the page separate; otherwise, one block that has all the lines (none when the page has no text).

public IReadOnlyList<PdfTextBlock> Blocks { get; }

Gets the lines of the page, in the order of the content or in the reading order (PdfTextExtractionOptions.ReadingOrder).

public IReadOnlyList<PdfTextLine> Lines { get; }

Gets the text of the page: the text of the lines separated by line feeds, the result of PdfPage.ExtractText.

public string Text { get; }

Property value

string

Methods

NameDescription
ToString()Returns a string that represents the current object.

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.