XmpMetadata
Overview
XmpMetadata is a class in Aspose.PDF FOSS for .NET.
Provides access to XMP metadata embedded in the PDF.
This class declares 11 methods for XmpMetadata objects in .NET programs.
Available methods include: Add, ContainsKey, Get, GetArray, GetXmpValue, RegisterNamespaceUri, Remove, Set, SetArray, ToXml.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Count, IsDirty, Keys, PdfAidConformance, PdfAidPart.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Keys | IEnumerable<string> | Read | All metadata property keys (flat string properties plus any structured named-value properties). |
Count | int | Read | Number of properties. |
PdfAidPart | string? | Read/Write | Get PDF/A identification part (pdfaid:part), e.g. |
PdfAidConformance | string? | Read/Write | Get PDF/A identification conformance level (pdfaid:conformance), e.g. |
IsDirty | bool | Read | Whether the metadata has been modified since loading. |
Methods
| Signature | Description |
|---|---|
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. |