Provides access to PDF document metadata properties including standard document information dictionary fields and XMP metadata.
This class allows reading and writing of standard PDF metadata fields such as title, author, subject, and keywords, as well as custom metadata properties. All changes to metadata properties are immediately applied to the underlying PDF document.
using Nutrient;The SDK creates this class through factory methods or other SDK objects.
Properties
Author
public string Author { get; set; }The name of the person that created the document.
Type: string
CreationDate
public string CreationDate { get; }The date and time the document was created.
Type: string
Creator
public string Creator { get; set; }The name of the application that created the original document.
Type: string
Keywords
public string Keywords { get; set; }The keywords associated with the document.
Type: string
ModificationDate
public string ModificationDate { get; }The date and time the document was most recently modified.
Type: string
Producer
public string Producer { get; set; }The name of the application that converted the document to PDF.
Type: string
Subject
public string Subject { get; set; }The subject of the document.
Type: string
Title
public string Title { get; set; }The title of the document.
Type: string
XMP
public string XMP { get; set; }The XMP metadata stream of the document.
Type: string
Methods
GetCustomPDFInformation
public string GetCustomPDFInformation(string key)Gets the value of a custom metadata property from the document information dictionary.
Parameters
| Name | Type | Description |
|---|---|---|
key | string | The name of the custom property to retrieve. |
Returns: string - The value of the custom property as a string. Returns an empty string if the property does not exist.
SetCustomPDFInformation
public void SetCustomPDFInformation(string key, string value)Sets the value of a custom metadata property in the document information dictionary.
Parameters
| Name | Type | Description |
|---|---|---|
key | string | The name of the custom property to set. |
value | string | The value to assign to the custom property. |
Resource management
public void Dispose()PdfMetadata implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.