module HexaPDF::Content::SmartTextExtractor::TextRunCollector

This module provides the functionality for collecting the necessary TextRun instances for layouting the text.

To use this module include it in a processor class. Then invoke the collect_text_runs method in the show_text and show_text_with_positioning methods.

Example:

class CustomProcessor < HexaPDF::Content::Processor
  include TextRunCollector

  def show_text(str)
    collect_text_runs(decode_text_with_positioning(str))
  end
  alias show_text_with_positioning show_text

end

Once the processor has done its job, the collected text runs are available via the text_runs method. Use them as input for SmartTextExtractor.layout_text_runs.

Constants

TextRun

Represents a single run of continuous glyphs and their combined bounding box in user space.

Attributes

text_runs[R]

Array with all collected TextRun instances.