Files
Marco Arnulfo d7590ebfbe fix(content): count an unreadable inline image with no EI as skipped (#1318) (#1418)
Follow-up to #1404. An inline image whose parameters can't be read and that has no EI after them ran to the end of the stream as a BI op with no data, and those bytes were not counted. It is now skipped like one with an EI, its bytes counted in Parsed::skipped. A stream that ends inside the parameters (BI /W 1) still keeps its BI op.
2026-10-12 08:38:01 -04:00
..
2026-10-07 16:03:57 -04:00

pdfcraft-content

Layer L2: content streams (ISO 32000-2 §7.8.2, §8, §9).

let parsed = parse(&stream.decoded()?);       // operators with operands and source spans
for op in &parsed.ops { if op.is("Tj") { /* … */ } }
let bytes = serialize_ops(&parsed.ops);       // write back (inline images kept whole)
let m = Matrix::from_operands(&op.operands);  // cm / Tm arithmetic, invert, bbox

The parser is tolerant (unreadable bytes are skipped and counted, never fatal) and never panics. redact and (later) edit build their interpreters on it; the graphics-state tracker and the Patch API of architecture §6 grow here.