Table of Contents

Method GetSpans

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

GetSpans()

Gets the text spans that represent the text captured by this group.

public IEnumerable<PdfTextSpan> GetSpans()

Returns

IEnumerable<PdfTextSpan>

A sequence of PdfTextSpan objects representing the captured text.

Remarks

If a quantifier is applied to a capturing group, this method returns text spans for the last captured substring. Use the Captures property to get information about all the substrings captured by the group.

A group's captured text can consist of multiple text fragments in the PDF document. Therefore, this method can return multiple spans.

The returned spans represent only text fragments present in the PDF content stream. Whitespace inferred from the positioning of text fragments is not represented by any span.

Text fragments are combined into a single span when both of the following conditions are met:

  • The fragments are located close to each other.
  • The fragments have the same state, including font, font size, character spacing, word spacing, horizontal scaling, text rendering mode, stroke and fill parameters, and layer.