PdfDocumentInformation Class

The document information dictionary (ISO 32000-2, 14.3.3), the /Info entry of the trailer. Setting a value creates the dictionary; setting null removes the entry.

public sealed class PdfDocumentInformation

Remarks

PDF 2.0 deprecates every entry but the dates in favor of the XMP metadata: PdfDocument.UpdateXmpMetadata writes these values to it.

Properties

NameDescription
AuthorGets or sets the name of the person who created the document.
CreationDateGets or sets the date the document was created, or null when it is missing or not a valid date.
CreatorGets or sets the name of the application that created the original document.
DictionaryGets the information dictionary, or null when the document has none.
KeywordsGets or sets the keywords of the document.
ModificationDateGets or sets the date the document was last modified, or null when it is missing or not a valid date.
ProducerGets or sets the name of the application that converted the document to PDF.
SubjectGets or sets the subject of the document.
TitleGets or sets the title of the document.
TrappedGets or sets whether the document includes the trapping information of prepress workflows (the /Trapped entry), or null when the entry is missing or not valid. The XMP metadata has it as pdf:Trapped.

Gets or sets the name of the person who created the document.

public string? Author { get; set; }

Property value

string?

Gets or sets the date the document was created, or null when it is missing or not a valid date.

public DateTimeOffset? CreationDate { get; set; }

Property value

DateTimeOffset?

Gets or sets the name of the application that created the original document.

public string? Creator { get; set; }

Property value

string?

Gets the information dictionary, or null when the document has none.

public PdfDictionary? Dictionary { get; }

Property value

PdfDictionary?

Gets or sets the keywords of the document.

public string? Keywords { get; set; }

Property value

string?

Gets or sets the date the document was last modified, or null when it is missing or not a valid date.

public DateTimeOffset? ModificationDate { get; set; }

Property value

DateTimeOffset?

Gets or sets the name of the application that converted the document to PDF.

public string? Producer { get; set; }

Property value

string?

Gets or sets the subject of the document.

public string? Subject { get; set; }

Property value

string?

Gets or sets the title of the document.

public string? Title { get; set; }

Property value

string?

Gets or sets whether the document includes the trapping information of prepress workflows (the /Trapped entry), or null when the entry is missing or not valid. The XMP metadata has it as pdf:Trapped.

public PdfTrapped? Trapped { get; set; }

Property value

PdfTrapped?

Exceptions

ArgumentOutOfRangeException
The value is not a member of PdfTrapped.

Methods

NameDescription
GetText(string)Gets the value of an entry as a text, such as a custom entry.
SetText(string, string?)Sets the value of an entry to a text, or removes it.

Gets the value of an entry as a text, such as a custom entry.

public string? GetText(string key)

Parameters

key string
The key.

Returns

string? The text, or null.

SetText(string, string?)

PdfDocumentInformation.cs

Sets the value of an entry to a text, or removes it.

public void SetText(string key, string? value)

Parameters

key string
The key.
value string?
The text, or null to remove the entry.