TextExtractor Class

Definition

Namespace Broadside.Text
Assembly Broadside.dll
Show inherited members (20)

The content processor that extracts positioned text: every glyph a run shows, with its Unicode text, its box and origin in page space, its font, size and rendering mode. Runs alone through ExtractText(), or beside other processors in one run through CompositeContentProcessor.

public sealed class TextExtractor : ContentProcessor

Remarks

ISO 32000-2 §9.4.4 (glyph positions), §9.10 (Unicode), §9.3.6 (rendering modes), §8.11.3.1 (optional content) and §14.9.4 (replacement text). Glyphs shown by form XObjects are extracted where the form paints them. A Type 3 glyph is one glyph, mapped to Unicode like any other; its glyph description is not run, so text inside it is part of its appearance, not of the page's text. Glyphs in Artifact marked-content sequences (§14.8.2.2) are left out unless IncludeArtifacts asks for them.

The extractor gives page content order. ExtractText(TextExtractionOptions) puts a tagged page in logical content order from the structure tree (§14.8.2.5.1, TextReadingOrder); the extractor records, for that, the content item each glyph is shown in. Words, Lines and PlainText group the glyphs in content order (§14.8.2.6.2; see TextWord and TextLine), assembled when first read after a run.

Glyphs accumulate over runs until Clear(); the buffers are kept, so an extractor reused for page after page allocates nothing per glyph once its buffers have grown. Not thread-safe: use one extractor per thread.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Constructors (2)

Properties (6)

Methods (11)