Expand description
Minimal, zero-dependency PDF object/xref/stream writer for lightweight-pdf.
Never sees Element/RenderNode — only flat write operations
(plan/00a-contracts-and-artifacts.md, point 3).
Structs§
- CidFont
- A subset, embedded TrueType font written as
/Subtype /Type0with a/CIDFontType2descendant (ADR-012: Identity-H,CIDToGIDMap,ToUnicode). CID space equals the subset’s own glyph-index space (the facade assigns CIDs that way), soCIDToGIDMapis always/Identityand no separate CID-to-GID stream is needed. - Content
Builder - ImageX
Object - One embeddable
/Subtype /ImageXObject (ISO 32000-1 8.9.5), named for that specific PDF construct the same wayCidFontis named for its (Type0/CIDFontType2) construct, rather than for the generic Pdf-noun pattern used byPdfPage/PdfDocument/PdfWriter(those name the crate’s document-structure types; this andCidFontname embeddable resource types).smask, if present, is itself anImageXObject(alwaysDeviceGray,filter: None, no furthersmask) — PNG alpha, per ADR-013. - PdfDocument
- PdfLink
Annotation - PdfMetadata
- PdfOutline
Node - One entry in the
/Outlinesbookmark tree (Text::outline_level, resolved).page_index/ymean the same thing asPdfLinkAction::GoTo— resolved againstpage_refsat write time, not by the caller. - PdfPage
- PdfWriter
- Ref
- A PDF indirect object reference (generation is always 0 in V1 — we never rewrite an existing file).
- Rgb
- Text
Rotation - The position/orientation operands for
ContentBuilder::text_rotated, grouped into one argument so the method stays under clippy’s too-many-arguments threshold without merging it intoContentBuilder::text.
Enums§
Functions§
- fmt_num
- Formats an
f32with a fixed, compact precision suitable for PDF content streams (avoids Rust’s default floatDisplay, which can emit scientific notation or excessive digits).