Expand description
Top-level reader — bytes → resolved [Document] / Scene.
Glues crate::reader::xref (locate + parse cross-reference
table) and crate::reader::parse (decode an indirect object at
a given byte offset) into a one-shot pipeline:
- [
load_xref] — locatestartxref, parse the xref table, keep the trailer dict. - [
fetch_object] — given anObjectId, seek to the byte offset, decode the indirect object’s body (recursively resolving references on demand). read_pdf_to_scene— top-level entry point: bytes →oxideav_scene::Scenein pages mode. Walks the catalog → pages tree → per-page Contents → content-stream parser, and extracts /Info →Metadata.
Round 3 supports PDF 1.4 with a simple xref + uncompressed object streams. FlateDecode-compressed Contents streams are decoded here — the writer FlateDecode-compresses image XObjects + may later compress content streams; supporting it now keeps the reader symmetric with the writer’s output. Object streams (PDF 1.5+) and encryption are deferred to round 4+.
Structs§
- Document
Reader - A read-time view of the PDF document — owns the byte slice plus a
resolved cross-reference table and a small object cache. Indirect
objects are decoded lazily via
Self::resolve.
Functions§
- decode_
stream - Apply the stream’s
/Filter(if any) to recover the raw payload. - pdf_
date_ to_ iso8601 - Convert a PDF date
D:YYYYMMDDHHmmSSOHH'mm'back to ISO-8601. Inputs that don’t start withD:are returned as-is so the scene’s metadata round-trip is lossless for non-date strings. - read_
pdf_ to_ scene - Convenience — open + read straight into a
Scenein pages mode. Inverse ofcrate::write_pdf_from_scenefor PDFs the writer would produce. - read_
pdf_ to_ scene_ with_ certificate - Like
read_pdf_to_scenebut unlocks a public-key-encrypted PDF (adbe.pkcs7.s3/s4/s5) using the supplied X.509 certificate + RSA private key. Round-10 implementation; seecrate::pubsecfor SubFilter and crypt-method coverage. - read_
pdf_ to_ scene_ with_ certificate_ and_ trust_ store - Round-17: variant of
read_pdf_to_scene_with_certificatethat consults aTrustStorewhen a KARI envelope identifies the originator byIssuerAndSerialorSubjectKeyIdentifier(RFC 5652 §6.2.2) instead of carrying its public point in-band. - read_
pdf_ to_ scene_ with_ password - Like
read_pdf_to_scenebut accepts a user / owner password for encrypted PDFs.