PdfXmpMetadata
Overview
PdfXmpMetadata is a class in Aspose.PDF FOSS for .NET.
Inherits from: IDictionary<string, XmpValue>.
Dictionary-style facade over a PDF document’s XMP metadata stream.
This class provides 31 methods for working with PdfXmpMetadata objects in .NET programs.
Available methods include: Add, BindPdf, Clear, Close, Contains, ContainsKey, CopyTo, GetEnumerator, GetNamespaceURIByPrefix, GetPrefixByNamespaceURI, GetXmpMetadata, PdfXmpMetadata, and 4 additional methods.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Count, ExtensionFields, IsFixedSize, IsReadOnly, IsSynchronized, Keys, and 2 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Count | int | Read | Number of metadata properties currently set. |
IsReadOnly | bool | Read | Gets the is read only. |
IsFixedSize | bool | Read | Always false: callers may add and remove keys. |
IsSynchronized | bool | Read | True: this facade is single-threaded; callers serialise their own access. |
SyncRoot | object | Read | Sentinel object returned for SyncRoot-style locking. |
Keys | ICollection<string> | Read | All property keys present in the bound metadata. |
Values | ICollection<XmpValue> | Read | All property values present in the bound metadata. |
ExtensionFields | IDictionary<string, XmpPdfAExtensionSchema> | Read | PDF/A extension fields, keyed by extension namespace prefix. |
Methods
| Signature | Description |
|---|---|
PdfXmpMetadata() | Construct an unbound facade. |
PdfXmpMetadata(document: Aspose.Pdf.Document) | Construct a facade already bound to document. |
BindPdf(path: string) | Bind a PDF document by path for subsequent operations. |
BindPdf(input: Stream) | Bind a PDF stream for subsequent operations. |
BindPdf(document: Aspose.Pdf.Document) | Bind a live document for subsequent operations. |
BindPdf(inputPath: string, outputPath: string) | Bind a PDF document by path, target the given output path when Save() is called later. |
Save() | Save the bound document with any XMP metadata edits to the output path supplied to BindPdf(string, string), falling back to the input path. |
Save(outputStream: Stream) | Save the bound document with its XMP edits to a stream. |
Save(outputFile: string) | Save the bound document with its XMP edits to an output path. |
Close() | Release the bound document / metadata, completing the BindPdf / Save / Close lifecycle. |
Add(key: string, value: XmpValue) | Add a property by raw key. |
Add(key: string, value: object) | Add a property by raw key with an arbitrary object value. |
Add(key: DefaultMetadataProperties, value: XmpValue) | Add a property by well-known DefaultMetadataProperties key. |
Add(item: KeyValuePair<string, XmpValue>) | Add a key/value pair (IDictionary contract). |
Add(xmpPdfAExtensionObject: XmpPdfAExtensionObject, namespacePrefix: string, namespaceUri: string, schemaDescription: string) | Register a PDF/A extension object under namespacePrefix. |
Clear() | Remove every property from the bound metadata. |
Contains(key: string) | Whether the bound metadata contains the given raw key. |
Contains(property: DefaultMetadataProperties) | Whether the bound metadata contains the given well-known property. |
Contains(item: KeyValuePair<string, XmpValue>) | Whether the bound metadata contains the exact key/value pair. |
ContainsKey(key: string) | Calls ContainsKey on this PdfXmpMetadata instance. |
CopyTo(array: KeyValuePair<string, XmpValue>[], index: int) | Copy all key/value pairs into array starting at index. |
GetEnumerator() | Calls GetEnumerator on this PdfXmpMetadata instance. |
GetNamespaceURIByPrefix(prefix: string) | Resolve a registered prefix to its XML namespace URI, or null. |
GetPrefixByNamespaceURI(namespaceURI: string) | Reverse lookup: namespace URI to its registered prefix, or null. |
GetXmpMetadata() | Serialise the entire bound XMP packet as a UTF-8 byte array. |
GetXmpMetadata(name: string) | Serialise just the property named name as a UTF-8 byte array. |
RegisterNamespaceURI(prefix: string, namespaceURI: string) | Register an XML namespace prefix → URI mapping. |
Remove(key: string) | Remove the property at key; returns true if it existed. |
Remove(key: DefaultMetadataProperties) | Remove the property indexed by the well-known DefaultMetadataProperties key. |
Remove(item: KeyValuePair<string, XmpValue>) | Remove the exact key/value pair if it is currently present. |
TryGetValue(key: string, value: XmpValue) | Calls TryGetValue on this PdfXmpMetadata instance. |