Class PdfMetaData
A class defining PDF file MetaData.
Allows File MetaData to be read and set including: Authors, File Dates, Keywords, Title and Subject
Implemented in IronPdf.MetaData.
Inheritance
Namespace: IronPdf.MetaData
Assembly: IronPdf.dll
Syntax
public class PdfMetaData : Object
PdfMetaData is the object IronPDF C# code works with for PDF metadata. It represents class defining PDF file MetaData.
PdfMetaData matters when an application needs to configure or invoke PDF metadata from C# code. The class encapsulates the related options and behavior in a single object that is set up once and reused across render or processing calls. Typical scenarios include batch generation pipelines, templated document workflows, and integration with existing C# document services.
To use PdfMetaData, instantiate or obtain it from the relevant entry point in the IronPDF C# API. Key properties include Author, CreationDate, Creator, CustomProperties. Assign options or invoke methods on the instance to configure or perform the operation. The HTML file to PDF covers typical usage in C# end to end.
using IronPdf;
// Obtain PdfMetaData from the relevant entry point in the IronPDF API
void Configure(PdfMetaData instance)
{
var current = instance.Author;
instance.GetMetaDataDictionary();
}For the broader workflow, see the HTML zip file to PDF guide in the IronPDF C# documentation. For broader context, the PDF metadata portion of the IronPDF C# API contains related types that work with PdfMetaData directly. PdfMetaData exposes additional members beyond those highlighted above; the reference tables on this page list the full set. In application code, treat PdfMetaData as a configured object that is constructed once and reused across operations rather than instantiated per call. Configuration is generally idempotent: assigning the same property value twice has the same effect as assigning it once. For diagnostic purposes, inspect the relevant PdfMetaData property after each operation to confirm the configured state. See the constructors, properties, and methods tables below for the complete API surface of PdfMetaData. Application code typically obtains or instantiates a single PdfMetaData and shares it across multiple IronPDF operations rather than recreating it per call.
Properties
Author
Gets or sets the Author of the document.
Declaration
public string Author { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The author name as a string. |
CreationDate
Gets or sets the PDF file creation DateTime.
Declaration
public DateTime CreationDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime | DateTime of PDF file creation as a Local Time. Use CreationDate.ToUniversalTime() to return a UTC DateTime |
Creator
Gets or sets the Creator of the document.
Declaration
public string Creator { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The creator name as a string. |
CustomProperties
Property defining custom MetaData properties of the document.
Declaration
public PdfCustomMetadataProperties CustomProperties { get; }
Property Value
| Type | Description |
|---|---|
| PdfCustomMetadataProperties |
Keywords
Gets or sets the Keywords of the document. This helps search indexes and operating systems correctly index the PDF.
Declaration
public string Keywords { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The Keywords of the document as a string. It is customary to use comma separation between keywords. |
ModifiedDate
Gets or sets the PDF file last-modified DateTime.
Declaration
public DateTime ModifiedDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime | DateTime of PDF file modification as a Local Time. Use ModifiedDate.ToUniversalTime() to return a UTC DateTime. |
Producer
Gets or sets the Producer of the document.
Declaration
public string Producer { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The producer name as a string. |
Subject
Gets or sets the Subject of the document. This helps search indexes and operating systems correctly index the PDF, and may appear in PDF viewer software.
Declaration
public string Subject { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The Subject of the document as a string. |
Title
Gets or sets the Title of the document. This helps search indexes and operating systems correctly index the PDF, and may appear in PDF viewer software.
Declaration
public string Title { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The Title of the document as a string. |
Methods
GetMetaDataDictionary()
Gets all available MetaData as a dictionary.
Declaration
public Dictionary<string, string> GetMetaDataDictionary()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.String> | Current MetaData dictionary |
Keys()
Gets all available MetaData keys of the document.
Declaration
public List<string> Keys()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> |
RemoveMetaDataKey(String)
Removes a MetaData key of the document.
Declaration
public void RemoveMetaDataKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key |
SetMetaDataDictionary(Dictionary<String, String>)
Overwrites whole MetaData from a given dictionary.
This method is the fastest and most efficient way to edit or clear PDF MetaData. Highly recommended for Docker / GRPC usage.
Declaration
public void SetMetaDataDictionary(Dictionary<string, string> newDictionary)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<System.String, System.String> | newDictionary | a new MetaData dictionary |