Skip to main content

XmpPacket

Struct XmpPacket 

Source
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:subjectrdf: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:TrappedTrue / 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

Source

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.

Source

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.

Source

pub fn pdf_a_conformance(&self) -> Option<String>

PDF/A conformance designator like 1B or 2A — concatenation of part + conformance — when both are declared.

Trait Implementations§

Source§

impl Clone for XmpPacket

Source§

fn clone(&self) -> XmpPacket

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for XmpPacket

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for XmpPacket

Source§

fn default() -> XmpPacket

Returns the “default value” for a type. Read more
Source§

impl Eq for XmpPacket

Source§

impl PartialEq for XmpPacket

Source§

fn eq(&self, other: &XmpPacket) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for XmpPacket

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V