laminapdf-syntax 0.2.0-alpha.2

PDF syntax layer: object model, serialization, lexer, parser and stream filters (pure, bytes in / bytes out).
Documentation

laminapdf-syntax

The PDF syntax layer of Lamina PDF's pure core (bytes in, bytes out): the object model (Object, Dict, Name, PdfString, Stream, ObjRef) with byte-exact serialization, the lexer, the object parser (which report, through reached_end, whether a result depended on bytes past the end of the input, so laminapdf-cos can parse windows of a larger file), the stream filters (Flate, PNG predictors), crypt (standard security handler decryption: password authentication for R2–R6, RC4/AES-128/AES-256, read only; ISO 32000-2 §7.6), and Limits, the resource limits of ADR 0003 that bound nesting, string length, decoded bytes and filter chains, and text: text-string decoding and encoding (decode_text_string: PDFDocEncoding, UTF-16BE, UTF-8; encode_text_string: PDFDocEncoding when every character has a code, else UTF-16BE with a byte order mark; §7.9.2.2) with the workspace's one PDFDocEncoding table (Annex D), in both directions. ISO 32000-2 §7.2–7.4. It also defines Rotation, a rotation by a multiple of 90° read from a /Rotate value (§7.7.3.3), so the page model and the renderers share one type.

Ported from the pdf-basics spike in architecture Round A; see its design notes for the reasoning behind the rules (number formatting, string escaping, the depth limit, predictor bounds). The file structure built on top of this crate is in laminapdf-cos. Plan: docs/plans/architecture.md.

cargo test -p laminapdf-syntax