---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/Metadata
---

# Metadata

## Overview

`Metadata` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `IDictionary`.

XMP metadata accessor exposed by per-resource members such as Metadata.

This class provides 19 methods for working with Metadata objects in .NET programs.
Available methods include: `Add`, `Clear`, `Contains`, `ContainsKey`, `CopyTo`, `Get`, `GetEnumerator`, `GetNamespaceUriByPrefix`, `GetPrefixByNamespaceUri`, `RegisterNamespaceUri`, `Remove`, `SetPdfAidPart`, and 1 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 5 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 | Always false: callers serialise their own access. |
| `SyncRoot` | `object` | Read | Sentinel object for ICollection.SyncRoot-style locking. |
| `Keys` | `ICollection` | Read | All property keys present in the bound metadata. |
| `Values` | `ICollection` | Read | All property values present in the bound metadata. |
| `NamespaceManager` | `XmlNamespaceManager` | Read | Live XmlNamespaceManager driving prefix → URI resolution. |
| `ExtensionFields` | `IDictionary` | Read | PDF/A extension fields, keyed by extension namespace prefix. |
| `PdfAidPart` | `string?` | Read | PDF/A part identifier from pdfaid:part, or null. |
| `PdfAidConformance` | `string?` | Read | PDF/A conformance level from pdfaid:conformance, or null. |

## Methods

| Signature | Description |
|-----------|-------------|
| `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(item: KeyValuePair)` | Add a key/value pair (IDictionary contract). |
| `Add(prefix: string, value: XmpPdfAExtensionObject)` | Add a PDF/A extension property under prefix. |
| `Clear()` | Remove every property from the bound metadata. |
| `Contains(key: string)` | Whether the bound metadata contains the given raw key. |
| `Contains(item: KeyValuePair)` | Whether the bound metadata contains the exact key/value pair. |
| `ContainsKey(key: string)` | Calls ContainsKey on this Metadata instance. |
| `CopyTo(array: KeyValuePair[], index: int)` | Copy all key/value pairs into array starting at index. |
| `GetEnumerator()` | Calls GetEnumerator on this Metadata 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. |
| `RegisterNamespaceUri(prefix: string, namespaceUri: string)` | Register an XML namespace prefix → URI mapping. |
| `RegisterNamespaceUri(prefix: string, namespaceUri: string, schemaDescription: string?)` | Register an XML namespace prefix → URI mapping along with a schema description (carried for PDF/A extension wiring). |
| `Remove(key: string)` | Remove the property at key; returns true if it existed. |
| `Remove(item: KeyValuePair)` | Remove the exact key/value pair if it is currently present. |
| `TryGetValue(key: string, value: XmpValue)` | Calls TryGetValue on this Metadata instance. |
| `Get(key: string)` | Get a property's string value by raw key, or null if absent. |
| `SetPdfAidPart(part: string, conformance: string?, amd: string?)` | Set the PDF/A identifier triple (part, conformance, optional amd amendment string). |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)