Pdf | |
The PdfDocument type exposes the following members.
| Name | Description | |
|---|---|---|
| Bookmarks | Gets the document-level bookmark (outline) collection. Use this to add navigation entries that appear in the PDF reader's outline pane. | |
| CompressionLevel | 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. | |
| DocumentInformation | Gets the document information properties (title, author, subject, etc.). | |
| Fonts | 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. | |
| Footer | Gets or sets the template repeated at the bottom of every page of the pdf document. | |
| Header | Gets or sets the template repeated at the top of every page of the pdf document. | |
| JpegCompressionEnabled | Gets or sets a flag indicating if JPEG compression is applied to the images in the generated pdf document. Default is true. | |
| JpegCompressionLevel | 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. | |
| Language | 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. | |
| LFN | 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. | |
| Margins | The default pdf document margins. New pages will use the default margins if no margins are specified when the page is added. | |
| Pages | Gets the collection of pages in the document. | |
| Security | Gets the security settings of the document. | |
| Templates | 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. | |
| Title | 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. | |
| ViewerPreferences |
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. |