PdfDocumentProperties Class

Definition

The common document properties, each read from the XMP metadata when it has it and from the Info dictionary otherwise, and written to both in sync.

public sealed class PdfDocumentProperties

Remarks

ISO 32000-2 §14.3.1 ("The preferred method in PDF 2.0" is the metadata stream), §14.3.3 Table 349 (which XMP property each Info entry corresponds to) and §14.3.4 (when the two disagree, which one a reader uses is its own decision). Each property comes from the readable XMP packet of Metadata when that packet has the property, else from Information. Disagreement is not a deviation and is not reported.

Reads both sources on every call. Use Information and Packet to see each one.

Setting a property writes it at once to both sources (§14.3.4: the two "are fully equivalent"); null removes it from both. The XMP packet is written when the document has a metadata stream, is PDF 2.0, or is PDF 1.4 or later (a new stream is added to the catalog); every other property of an existing packet is kept, and xmp:MetadataDate becomes the engine's clock (UseTimeProvider(TimeProvider)). The Info dictionary is written before PDF 2.0, added to the trailer when absent; in a PDF 2.0 document it keeps only CreationDate, ModDate and keys Table 349 does not define, and the deprecated entries it held move to the packet (§14.3.3). Entries only one source has are copied to the other; entries the two disagree on and that are not being set are left as they are. Dates are written to the second in the offset they carry. Saving a changed document then dates the modification (UpdateModificationDate).

Setting is a mutation: no read may run concurrently with it. In strict mode, a deviation found while reading the current values throws DiagnosticException. Characters XML cannot carry (most C0 controls) are left out of the packet.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (8)