Table of Contents

Class DocumentMetadata

Namespace
DocToolkit
Assembly
DocToolkit.Primitives.dll

The document properties a DOCX, XLSX or PPTX file carries about itself — what a file manager shows in its properties panel, and what a search indexer reads.

public sealed class DocumentMetadata
Inheritance
DocumentMetadata
Inherited Members

Remarks

Shared across all three OOXML formats because their underlying property bags are identical in shape — the same convention as DocumentSignatureInfo, which is also one type reused by DocxEditor, WorkbookEditor and PresentationEditor rather than three near-duplicates. It is not shared with the PDF-specific PdfMetadata: PDF's Info dictionary is a different schema, and one field name would otherwise collide in a misleading way — see Creator below.

Every property is nullable, and null means absent rather than blank — the same rule PdfMetadata uses, for the same reason: an absent title should be replaced by a fallback, while a deliberately empty one should not. The relevant With*Metadata method on each editor applies the rule in the other direction — a null property leaves whatever the document already had alone, so stamping a title does not silently erase an author. Pass an empty string to clear one.

Properties

Creator

Who wrote it — OOXML's own dc:creator core property.

public string? Creator { get; init; }

Property Value

string

Remarks

A different concept from PDF's own Creator property. The two ecosystems use the same word for two different things: OOXML's Creator names the person who authored the document (what PdfMetadata.Author means for a PDF), while PDF's own Creator names the application that produced the file. This type keeps OOXML's own name for its own property rather than renaming it to "Author" and inventing a false symmetry with PdfMetadata that the two formats do not actually share.

Keywords

Comma-separated keywords, by convention rather than by the specification.

public string? Keywords { get; init; }

Property Value

string

Subject

What it is about — a one-line description.

public string? Subject { get; init; }

Property Value

string

Title

The document's title. Not the file name, and often not set at all.

public string? Title { get; init; }

Property Value

string