Click or drag to resize
Pdf Library for .NET

PdfDocument Properties

The PdfDocument type exposes the following members.

Properties
 NameDescription
Public propertyAccessibilityStandard Gets or sets the universal accessibility standard the document declares. The default is None.
Public propertyBookmarks Gets the document-level bookmark (outline) collection. Use this to add navigation entries that appear in the PDF reader's outline pane.
Public propertyCompressionLevel Gets or sets the Flate/DEFLATE compression level applied to content streams, fonts, and non-image objects in the PDF. Complements JpegCompressionEnabled, which handles image XObjects. Default is Normal.
Public propertyDocumentInformation Gets the document information properties (title, author, subject, etc.).
Public propertyFonts Gets the document-level font collection. Use doc.Fonts.Add(...) to register fonts (standard, CJK, or embedded TrueType) that can be retrieved later by index and reused across PdfTextElement instances. For PDF/A output from scratch, add a TrueType font via Add(String) or Add(Byte) — the 14 built-in PdfStandardFont values are not allowed under PDF/A and will throw a PdfDocumentException when used.
Public propertyFooter Gets or sets the template repeated at the bottom of every page of the pdf document.
Public propertyHeader Gets or sets the template repeated at the top of every page of the pdf document.
Public propertyJpegCompressionEnabled Gets or sets a flag indicating if JPEG compression is applied to the images in the generated pdf document. Default is true.
Public propertyJpegCompressionLevel Gets or sets the JPEG compression level for images in the generated pdf document. Value range: 0 (lowest compression, best quality) to 100 (highest compression, worst quality). Only effective when JpegCompressionEnabled is true. Default is 10.
Public propertyLanguage Gets or sets the natural language of the document content (for example "en-US"), written as the document /Lang entry. Required for accessible / PDF/UA output.
Public propertyLFN Gets or sets the path of the diagnostic log file written while html content is rendered into this document. It is passed to the html elements added to the document's pages, and to the templates obtained through AddTemplate(Single, Single), Header and Footer. A template or html element that has a log file of its own keeps it. When none is set, no log is written.
Public propertyMargins The default pdf document margins. New pages will use the default margins if no margins are specified when the page is added.
Public propertyOpenAction Gets the action performed when the document is opened in a viewer. Set Action on the returned object to a PdfActionGoTo (jump to a destination) or PdfActionJavaScript (run a script).
Public propertyPages Gets the collection of pages in the document.
Public propertySecurity Gets the security settings of the document.
Public propertyTagged Gets or sets a value indicating whether the document produces a tagged (accessible) logical structure. Required for PDF/UA and PDF/A-3A conformance.
Public propertyTemplates Gets the collection of reusable templates of the document. A template is repeated on more than one page (headers, footers, watermarks, page numbers). Routed onto the document at save time.
Public propertyTitle Gets or sets the document title. For a tagged document this is written as the title metadata and, together with DisplayDocTitle, is required for PDF/UA conformance.
Public propertyViewerPreferences Gets the viewer-preferences block that controls how the document appears in a pdf reader — which panel opens (bookmarks, thumbnails, full-screen), whether the reader's tool bar / menu bar / window UI is hidden, whether the window resizes to the first page, and so on. Mutations write through to the underlying PDF immediately. Works on every document origin — newly-created documents, loaded documents, and HtmlToPdf output.

For the HtmlToPdf pipeline, ViewerPreferences is the pre-conversion knob; the two are complementary — set options before conversion, then fine-tune the returned document via this property.

Top
See Also