Document properties
Create a PDF with metadata
Set properties that PDF readers and document-management systems expose without inspecting the visible page content.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Add useful PDF metadata during export
PDF properties help users and document-management systems identify, search, and classify generated files without parsing their visible page content.
The values entered here are written into the PDF information dictionary during the same save operation that creates the document.
API used
SaveSettings.DocumentTitle
Key members
SaveSettings writes searchable document metadata during the same operation that creates the PDF stream.
var settings = new SaveSettings
{
DocumentTitle = request.Title?.Trim(),
Author = request.Author?.Trim(),
DocumentSubject = request.Subject?.Trim(),
CreatorApplication = request.CreatorApplication?.Trim(),
DocumentKeywords = request.Keywords
};
textControl.Save(out byte[] pdf, BinaryStreamType.AdobePDF, settings);
How it works
The request is mapped to a focused input model. Its title, author, subject, creator, and keywords are assigned to SaveSettings before ServerTextControl.Save exports the PDF.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Displays supported document and PDF formats in the browser.
dotnet add package TXTextControl.Web.DocumentViewer --version 34.2.0
Source files
See the implementation
The complete demo is encapsulated in Demos/Pdf/CreatingPdfs/DocumentSettings.