Skip to main content

Crate otf_pdf_text

Crate otf_pdf_text 

Source
Expand description

Text extraction: runs each page through the content interpreter with a device that collects glyphs, then groups them into lines and words.

  • Coordinates are in the page’s displayed space: origin at the crop box’s lower-left corner, /Rotate applied, y up, in points.
  • Reading order is the content stream’s, with glyphs that continue the same baseline joined into one line and gaps wider than a fifth of the font size read as spaces (like pdftotext -raw).
  • /ActualText replaces the glyphs it covers; invisible text (rendering mode 3, as in OCR layers) is included.

Structs§

PageText
The text of one page.
TextChar
One character (or /ActualText replacement) as drawn.
TextExtractor
Extracts text from a document. Fonts are loaded once and shared across pages.
TextLine
A line of text.
Word
A word: characters between spaces on one line.