Skip to main content

PdfDocument

PdfDocument

PdfDocument is the root builder for a generated PDF. It establishes document-wide settings, exposes pages, and owns the final output operation.

Typical flow​

PdfDocument.Create()
.WithPageSize(PdfPageSize.A4)
.Pages.Add()
// page content
.End()
.Save("output.pdf");

Common operations​

MemberPurpose
Create()Starts a new fluent document.
WithPageSize(...)Sets the document page size.
Pages.Add()Opens a page builder.
Save(path)Writes the finished PDF to a file.

The document builder is the place for settings that apply to the whole output, such as metadata, security, templates, and page defaults.