Expand description
The document model: loading, object resolution with caching, the lazily-flattened page tree with attribute inheritance, and document metadata.
Structs§
- Document
- A loaded PDF document.
- Document
Seed - A document’s immutable core, detached from its single-threaded caches:
the file bytes, the merged cross-reference table, the decryption key
material, and the flattened page tree.
Send + Sync(asserted in this module’s tests), which theDocumentdeliberately is not — this is the value that crosses a thread boundary, one fresh document materializing from it on each side. SeeDocument::seed,Document::from_seedandmap_pages. - Metadata
- Document information from the trailer
/Infodictionary. Only present, well-formed entries are populated. - Page
- A single page with inherited attributes already applied.
Functions§
- content_
stream_ data_ with - Fetches and decodes one CONTENT stream — page
/Contents, a form XObject, a Type3 CharProc, a pattern cell: anything whose bytes feed a content parser rather than an image decoder. - map_
pages - Applies
workto every page ofdocin parallel and returns the results in page order. - page_
content_ with - A page’s decoded content, awaiting each fetch: the
/Contentsstream, or all streams of a/Contentsarray decoded and joined withb"\n". A missing/Contentsyields empty content (lenient).