pub struct XmpPacket {Show 16 fields
pub dc_title: Option<String>,
pub dc_creator: Option<String>,
pub dc_description: Option<String>,
pub dc_subject: Vec<String>,
pub dc_rights: Option<String>,
pub dc_format: Option<String>,
pub xmp_create_date: Option<String>,
pub xmp_modify_date: Option<String>,
pub xmp_metadata_date: Option<String>,
pub xmp_creator_tool: Option<String>,
pub pdf_producer: Option<String>,
pub pdf_keywords: Option<String>,
pub pdf_version: Option<String>,
pub pdf_trapped: Option<String>,
pub pdfaid_part: Option<u8>,
pub pdfaid_conformance: Option<String>,
}Expand description
Structured view of an XMP packet’s most useful fields.
All fields are best-effort scrapes — a malformed packet may
produce partial data. Round-trip with a writer is not in scope:
XMP is generally written by external tools (Adobe XMP SDK,
exiftool, …) and read by the consumer.
Fields§
§dc_title: Option<String>dc:title — usually wrapped in rdf:Alt for language
alternatives; we surface the default-language sliver.
dc_creator: Option<String>dc:creator — author(s); we collapse the rdf:Seq to the
first entry (the common case is exactly one creator).
dc_description: Option<String>dc:description — same shape as dc:title.
dc_subject: Vec<String>dc:subject — rdf:Bag of keywords; we surface the full
list in document order.
dc_rights: Option<String>dc:rights — copyright statement; same shape as dc:title.
dc_format: Option<String>dc:format — usually application/pdf for PDF documents.
xmp_create_date: Option<String>xmp:CreateDate — ISO 8601 date-time at first creation.
xmp_modify_date: Option<String>xmp:ModifyDate — ISO 8601 date-time at last modification.
xmp_metadata_date: Option<String>xmp:MetadataDate — ISO 8601 date-time the XMP packet itself
was last touched.
xmp_creator_tool: Option<String>xmp:CreatorTool — application that authored the document
(e.g. Adobe InDesign 16.0).
pdf_producer: Option<String>pdf:Producer — application that wrote the PDF (often the
same as xmp:CreatorTool but distinct in pipelines that
separate authoring from rendering).
pdf_keywords: Option<String>pdf:Keywords — same comma-separated list a PDF /Info
dictionary’s /Keywords would carry.
pdf_version: Option<String>pdf:PDFVersion — version of the PDF spec the file targets.
pdf_trapped: Option<String>pdf:Trapped — True / False / Unknown per Adobe’s
trapping convention.
pdfaid_part: Option<u8>pdfaid:part — PDF/A part (1, 2, 3, 4) per ISO 19005-x.
pdfaid_conformance: Option<String>pdfaid:conformance — conformance level (A, B, U, E,
F) per ISO 19005-x §6.x.
Implementations§
Source§impl XmpPacket
impl XmpPacket
Sourcepub fn parse(bytes: &[u8]) -> Self
pub fn parse(bytes: &[u8]) -> Self
Parse an XMP packet from the raw bytes returned by
crate::reader::DocumentReader::xmp_metadata. Best-effort —
missing fields surface as None, never errors.
Sourcepub fn is_pdf_a(&self) -> bool
pub fn is_pdf_a(&self) -> bool
True when the packet declares a PDF/A identification (per
ISO 19005-x §6.x) — at minimum pdfaid:part is set.
Sourcepub fn pdf_a_conformance(&self) -> Option<String>
pub fn pdf_a_conformance(&self) -> Option<String>
PDF/A conformance designator like 1B or 2A — concatenation
of part + conformance — when both are declared.