Skip to main content

Crate pdfboss_text

Crate pdfboss_text 

Source
Expand description

Text extraction for pdfboss: font loading, encodings, ToUnicode CMaps, and positional text spans.

Structs§

ExtractReport
What extraction could not read. Extraction is lenient the way rendering is — content that will not fetch, decode, or parse yields no text rather than an error — and this report is what keeps that leniency accountable: an empty result with an empty report really is an empty page.
FontCache
Loaded fonts shared across page extractions of one document, keyed by the font dictionary’s object reference.
Point
A point in user or device space.
Rect
An axis-aligned rectangle described by two opposite corners (x0, y0) and (x1, y1).
Ruling
An axis-aligned line segment a page draws, in the same y-up user space as TextSpan: a table border, a separator, an underline.
SkippedText
One piece of content whose text (if any) is missing from the result.
TextSpan
A positioned run of extracted text.

Enums§

SkipCause
Why the stream was skipped.
SkippedTextKind
Which kind of operator stream was skipped.

Functions§

extract_spans
Extracts the page’s raw text spans (position, size and font per span).
extract_spans_and_rulings_reporting
extract_spans_reporting plus the page’s rulings: every axis-aligned segment the content strokes, and the centerline of every thin filled rectangle, in the same y-up user space as the spans. See Ruling for the normalization the returned segments carry.
extract_spans_and_rulings_reporting_cached
extract_spans_and_rulings_reporting with fonts cached across calls — the rulings twin of extract_spans_reporting_cached, for a caller walking a whole document page by page. Spans, rulings, and report are identical to the uncached call’s, for the same reason: the cache is keyed by each font dictionary’s object reference, never by its resource name, and rulings never touch fonts at all.
extract_spans_and_rulings_reporting_cached_with
extract_spans_and_rulings_reporting_cached against any object source. Signed like extract_spans_with, for the same reasons — oc gating included.
extract_spans_and_rulings_reporting_with
extract_spans_and_rulings_reporting against any object source. Signed like extract_spans_with, for the same reasons — oc gating included.
extract_spans_reporting
extract_spans with the report of what could not be read: an ExtractReport whose entries name each skipped stream and why — unsupported filters (the passthrough image codecs included), undecodable bytes, unparseable content, missing resources, exhausted form limits. An empty span list with an empty report really is an empty page.
extract_spans_reporting_cached
extract_spans_reporting with fonts cached across calls: a caller walking a whole document passes one FontCache to every page, and each font dictionary — descriptor, widths, encoding, ToUnicode and font-program parsing included — loads once for the document instead of once per page. The cache is Send + Sync, so a parallel page walk may share it.
extract_spans_reporting_cached_with
extract_spans_reporting_cached against any object source. Signed like extract_spans_with, for the same reasons — oc gating included.
extract_spans_reporting_with
extract_spans_reporting against any object source. Signed like extract_spans_with, for the same reasons — oc gating included.
extract_spans_with
extract_spans against any object source, awaiting whatever I/O the source needs to read the page.