xmp_writer

Struct XmpWriter

source
pub struct XmpWriter<'a> { /* private fields */ }
Expand description

The main writer struct.

Use XmpWriter::new to create a new instance and get the resulting XMP metadata by calling XmpWriter::finish.

Implementations§

source§

impl<'n> XmpWriter<'n>

source

pub fn new() -> XmpWriter<'n>

Create a new XMP writer.

source

pub fn element<'a>( &'a mut self, name: &'a str, namespace: Namespace<'n>, ) -> Element<'a, 'n>

Add a custom element to the XMP metadata.

source

pub fn finish(self, about: Option<&str>) -> String

Finish the XMP metadata and return it as a byte vector.

source§

impl XmpWriter<'_>

XMP Dublin Core Schema.

source

pub fn contributor<'a>( &mut self, contributor: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the dc:contributor property.

All entities responsible for making contributions to the resource not listed in XmpWriter::creator.

source

pub fn coverage(&mut self, coverage: &str) -> &mut Self

Write the dc:coverage property.

The scope of the resource.

source

pub fn creator<'a>( &mut self, creator: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the dc:creator property.

An entity primarily responsible for making the resource.

source

pub fn date(&mut self, date: impl IntoIterator<Item = DateTime>) -> &mut Self

Write the dc:date property.

Date(s) that something happened to the resource.

source

pub fn description<'a>( &mut self, description: impl IntoIterator<Item = (Option<LangId<'a>>, &'a str)>, ) -> &mut Self

Write the dc:description property.

An account of the resource, possibly in multiple languages.

source

pub fn format(&mut self, mime: &str) -> &mut Self

Write the dc:format property.

The mime type of the resource.

source

pub fn identifier(&mut self, id: &str) -> &mut Self

Write the dc:identifier property.

An unambiguous reference to the resource within a given context.

source

pub fn language<'a>( &mut self, lang: impl IntoIterator<Item = LangId<'a>>, ) -> &mut Self

Write the dc:language property.

Languges used in the resource.

source

pub fn publisher<'a>( &mut self, publisher: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the dc:publisher property.

Publishers of the resource.

source

pub fn relation<'a>( &mut self, relation: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the dc:relation property.

List of related resources.

source

pub fn rights<'a>( &mut self, rights: impl IntoIterator<Item = (Option<LangId<'a>>, &'a str)>, ) -> &mut Self

Write the dc:rights property.

Informal rights statements, possibly in multiple languages.

source

pub fn source(&mut self, source: &str) -> &mut Self

Write the dc:source property.

A related resource from which the described resource is derived.

source

pub fn subject<'a>( &mut self, subject: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the dc:subject property.

A list of phrases or keywords that specify the topic of the resource.

source

pub fn title<'a>( &mut self, title: impl IntoIterator<Item = (Option<LangId<'a>>, &'a str)>, ) -> &mut Self

Write the dc:title property.

A name given to the resource, possibly in multiple languages.

source

pub fn type_<'a>( &mut self, kind: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the dc:type property.

The nature or genre of the resource. Please use XmpWriter::format to specify the mime type.

source§

impl<'n> XmpWriter<'n>

XMP Basic Schema.

source

pub fn base_url(&mut self, url: &str) -> &mut Self

Write the xmp:BaseURL property.

The base URL for relative URLs in the document.

source

pub fn create_date(&mut self, date: DateTime) -> &mut Self

Write the xmp:CreateDate property.

The date and time the resource was created.

source

pub fn creator_tool(&mut self, tool: &str) -> &mut Self

Write the xmp:CreatorTool property.

The name of the application used to create the resource.

source

pub fn xmp_identifier<'a>( &mut self, id: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the xmp:Identifier property.

Unordered array of text strings that identify the resource. The XmpWriter::idq_scheme method can be used to specify the scheme.

source

pub fn label(&mut self, label: &str) -> &mut Self

Write the xmp:Label property.

A user-defined label for the resource.

source

pub fn metadata_date(&mut self, date: DateTime) -> &mut Self

Write the xmp:MetadataDate property.

The date and time the metadata for the resource was last changed.

source

pub fn modify_date(&mut self, date: DateTime) -> &mut Self

Write the xmp:ModifyDate property.

The date and time the resource was last modified.

source

pub fn nickname(&mut self, nickname: &str) -> &mut Self

Write the xmp:Nickname property.

A short informal name for the resource.

source

pub fn rating(&mut self, rating: i64) -> &mut Self

Write the xmp:Rating property.

A user-assigned rating of the resource.

source

pub fn thumbnails(&mut self) -> ThumbnailsWriter<'_, 'n>

Start writing the xmp:Thumbnails property.

A thumbnail image of the resource.

source§

impl XmpWriter<'_>

XMP Rights Management Schema.

source

pub fn certificate(&mut self, cert: &str) -> &mut Self

Write the xmpRights:Certificate property.

A URL with a rights management certificate.

source

pub fn marked(&mut self, marked: bool) -> &mut Self

Write the xmpRights:Marked property.

Whether the resource has been marked as rights managed. If false, the resource is in the public domain.

source

pub fn owner<'a>( &mut self, owner: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the xmpRights:Owner property.

A list of people or organizations owning the resource.

source

pub fn usage_terms<'a>( &mut self, terms: impl IntoIterator<Item = (Option<LangId<'a>>, &'a str)>, ) -> &mut Self

Write the xmpRights:UsageTerms property.

Under what conditions the resource may be used.

source

pub fn web_statement(&mut self, statement: &str) -> &mut Self

Write the xmpRights:WebStatement property.

A URL with a rights management statement.

source§

impl<'n> XmpWriter<'n>

XMP Media Management Schema.

source

pub fn derived_from(&mut self) -> ResourceRefWriter<'_, 'n>

Start writing the xmpMM:DerivedFrom property.

The document from which this document is derived.

source

pub fn document_id(&mut self, id: &str) -> &mut Self

Write the xmpMM:DocumentID property.

A common identifier for the document and all of its versions / renditions.

source

pub fn history(&mut self) -> ResourceEventsWriter<'_, 'n>

Start writing the xmpMM:History property.

A list of actions taken on the document.

source

pub fn ingredients(&mut self) -> ResourceRefsWriter<'_, 'n>

Write the xmpMM:Ingredients property.

A list of resources that were used to create the document.

source

pub fn instance_id(&mut self, id: &str) -> &mut Self

Write the xmpMM:InstanceID property.

A unique identifier for the rendition of the document, updated each time the document is saved.

source

pub fn managed_from(&mut self) -> ResourceRefWriter<'_, 'n>

Start writing the xmpMM:ManagedFrom property.

A reference to the document before it was managed.

source

pub fn manager(&mut self, manager: &str) -> &mut Self

Write the xmpMM:Manager property.

The name of the application that manages the document.

source

pub fn manage_to(&mut self, uri: &str) -> &mut Self

Write the xmpMM:ManageTo property.

The URI of the document in the management system.

source

pub fn manage_ui(&mut self, uri: &str) -> &mut Self

Write the xmpMM:ManageUI property.

A web page that allows the user to manage the document.

source

pub fn manager_variant(&mut self, variant: &str) -> &mut Self

Write the xmpMM:ManagerVariant property.

The name of the variant of the application that manages the document.

source

pub fn original_doc_id(&mut self, id: &str) -> &mut Self

Write the xmpMM:OriginalDocumentID property.

The ID of the resource from which this document was derived.

source

pub fn pantry(&mut self) -> PantryWriter<'_, 'n>

Start writing the xmpMM:Pantry property.

An unordered array of structs with custom properties, each of which must have an xmpMM:InstanceID property.

source

pub fn rendition_class(&mut self, class: RenditionClass<'_>) -> &mut Self

Write the xmpMM:RenditionClass property.

The type of the rendition. Shall be absent or RenditionClass::Default if this is not a derived document.

source

pub fn rendition_params(&mut self, params: &str) -> &mut Self

Write the xmpMM:RenditionParams property.

The parameters used to create the rendition.

source

pub fn version_id(&mut self, id: &str) -> &mut Self

Write the xmpMM:VersionID property.

A unique identifier for the version of the document.

source

pub fn version_ref(&mut self) -> VersionsWriter<'_, 'n>

Start writing the xmpMM:Versions property.

The list of versions of the document, starting with the oldest version.

source§

impl<'n> XmpWriter<'n>

Basic Job Management.

source

pub fn jobs(&mut self) -> JobsWriter<'_, 'n>

Start writing the xmpBJ:JobRef property.

A reference to jobs in a system that involves this resource.

source§

impl<'n> XmpWriter<'n>

Paged-text.

source

pub fn colorants(&mut self) -> ColorantsWriter<'_, 'n>

Start writing the xmpTPg:NPages property.

Colorants used in the document.

source

pub fn fonts(&mut self) -> FontsWriter<'_, 'n>

Start writing the xmpTPg:Fonts property.

Fonts used in the document.

source

pub fn max_page_size(&mut self) -> DimensionsWriter<'_, 'n>

Start writing the xmpTPg:MaxPageSize property.

The maximum page size in the document.

source

pub fn num_pages(&mut self, num: u32) -> &mut Self

Write the xmpTPg:NPages property.

The number of pages in the document.

source

pub fn plate_names<'a>( &mut self, names: impl IntoIterator<Item = &'a str>, ) -> &mut Self

Write the xmpTPg:PlateNames property.

The names of the plates needed to print the document.

source§

impl XmpWriter<'_>

XMPIDQ.

source

pub fn idq_scheme(&mut self, scheme: &str) -> &mut Self

Write the xmpidq:GImg property.

Identifies the scheme of the XmpWriter::xmp_identifier property.

source§

impl XmpWriter<'_>

Adobe PDF.

source

pub fn pdf_keywords(&mut self, keywords: &str) -> &mut Self

Write the pdf:Keywords property.

The document’s keywords.

source

pub fn pdf_version(&mut self, version: &str) -> &mut Self

Write the pdf:PDFVersion property.

The version of the PDF specification to which the document conforms (e.g. "1.0", "1.7")

source

pub fn producer(&mut self, producer: &str) -> &mut Self

Write the pdf:Producer property.

The name of the application that created the PDF document.

source

pub fn trapped(&mut self, trapped: bool) -> &mut Self

Write the pdf:Trapped property.

Whether the document has been trapped.

source§

impl<'n> XmpWriter<'n>

PDF/A and PDF/X.

source

pub fn pdfa_part(&mut self, part: i32) -> &mut Self

Write the pdfaid:part property.

The part of the PDF/A standard to which the document conforms (e.g. 1, 4)

source

pub fn pdfa_amd(&mut self, amd: &str) -> &mut Self

Write the pdfaid:amd property.

The amendment specifier this file conforms to, if any.

source

pub fn pdfa_corr(&mut self, corr: &str) -> &mut Self

Write the pdfaid:corr property.

The corrigendum specifier this file conforms to, if any.

source

pub fn extension_schemas(&mut self) -> PdfAExtSchemasWriter<'_, 'n>

Start writing the pdfaExtension:schemas property.

Description of all extension schemas used in the document.

source

pub fn pdfa_conformance(&mut self, conformance: &str) -> &mut Self

Write the pdfaid:conformance property.

The conformance level of the PDF/A standard to which the document conforms (e.g. "A", "B")

source

pub fn pdfx_version(&mut self, version: &str) -> &mut Self

Write the pdfxid:GTS_PDFXVersion property.

The version of the PDF/X standard to which the document conforms (e.g. "PDF/X-3:2003")

Trait Implementations§

source§

impl<'a> Default for XmpWriter<'a>

source§

fn default() -> XmpWriter<'a>

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

Auto Trait Implementations§

§

impl<'a> Freeze for XmpWriter<'a>

§

impl<'a> RefUnwindSafe for XmpWriter<'a>

§

impl<'a> Send for XmpWriter<'a>

§

impl<'a> Sync for XmpWriter<'a>

§

impl<'a> Unpin for XmpWriter<'a>

§

impl<'a> UnwindSafe for XmpWriter<'a>

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<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, 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.