Skip to main content

Module metadata

Module metadata 

Source
Expand description

Document-level metadata: the Info dict and the XMP metadata stream.

PDF documents carry author/title/etc. in two places:

  1. The trailer’s /Info dict (legacy, present in nearly all PDFs).
  2. The catalog’s /Metadata stream (XMP XML, PDF 1.4+, increasingly the canonical form).

DocumentMetadata returns both: parsed Info-dict fields plus the raw XMP XML for callers that want to consume it themselves.

Date strings come in PDF’s own format (D:YYYYMMDDHHmmSSOHH'mm'); we parse them into a typed PdfDate.

Structs§

DocumentMetadata
Information about a PDF document, drawn from the trailer’s /Info dict and the catalog’s /Metadata stream.
PdfDate
A parsed PDF date string.

Enums§

TrappedFlag
/Trapped flag value.

Functions§

parse_document_metadata
Parse the trailer’s /Info dict and the catalog’s /Metadata stream into a DocumentMetadata.