XmpMetadata

Overview

XmpMetadata is a class in Aspose.PDF FOSS for .NET.

Provides access to XMP metadata embedded in the PDF.

This class provides 11 methods for working with XmpMetadata objects in .NET programs. Available methods include: Add, ContainsKey, Get, GetArray, GetXmpValue, RegisterNamespaceUri, Remove, Set, SetArray, ToXml. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Count, IsDirty, Keys, PdfAidConformance, PdfAidPart.

Properties

NameTypeAccessDescription
KeysIEnumerable<string>ReadAll metadata property keys.
CountintReadNumber of properties.
PdfAidPartstring?Read/WriteGet PDF/A identification part (pdfaid:part), e.g.
PdfAidConformancestring?Read/WriteGet PDF/A identification conformance level (pdfaid:conformance), e.g.
IsDirtyboolReadWhether the metadata has been modified since loading.

Methods

SignatureDescription
Get(key: string)Get a metadata property by key (e.g., “dc:title”, “xmp:CreatorTool”).
ContainsKey(key: string)Whether a key exists.
Set(key: string, value: string)Set a metadata property.
Add(key: string, value: XmpValue)Add a metadata property with a typed XmpValue.
Add(key: string, value: string)Add a metadata property with a string value.
GetXmpValue(key: string)Get a metadata property as a typed XmpValue, or null if not found.
Remove(key: string)Remove a metadata property.
GetArray(key: string)Get a metadata property as an array of values (for rdf:Seq/Bag properties like dc:creator, dc:subject).
SetArray(key: string, values: IEnumerable<string>)Set a metadata property as an array (serialized to rdf:Seq).
RegisterNamespaceUri(prefix: string, namespaceUri: string)Register a custom namespace URI for a prefix so that properties using that prefix can be serialized with the correct namespace declaration in ToXml().
ToXml()Serialize the metadata to an XMP/RDF XML string.

See Also