PeachPDF
PeachPDF Namespace
| Classes | |
|---|---|
| ClipReport | Every ClippedWord a single render produced, in paint order. |
| ColorOptions | Print color-management options, set via ColorOptions. Mirrors the Metadata/PdfDocumentMetadata nested-options pattern. |
| FacturXOptions | Turns the generated PDF into a Factur-X / ZUGFeRD hybrid e-invoice, via FacturX: a PDF/A-3 document that carries a human-readable invoice (the pages PeachPDF renders) together with the same invoice as structured XML, so software can process it without reading the pages. Factur-X (France) and ZUGFeRD (Germany) are one format under two names. |
| PdfAttachment | A file to embed in the generated PDF, added through Attachments. The file shows up in a viewer’s attachments panel and is indexed in the document catalog’s /AF (Associated Files) array and /Names /EmbeddedFiles name tree. |
| PdfDocumentMetadata | Optional document-information overrides applied to the generated PDF’s Info dictionary via Metadata. Each property is nullable: when a property is non-null it overrides the value extracted from the HTML source (<title> and the <meta name="author|subject|keywords|generator"> tags); when it is null the HTML-extracted value is used unchanged. |
| PdfEncryptionOptions | Password protection and permissions for a generated PDF, written with the PDF standard security handler using AES-256 (revision 6 of ISO 32000-2). Older handlers (RC4, AES-128) depend on deprecated algorithms and are not offered. |
| PdfGenerateConfig | The settings for generating PDF using PdfGenerator |
| PdfGenerator | Renders HTML (and optionally CSS) into a PDF document entirely in-process, with no external browser or process dependency. This is the main entry point for PeachPDF: use one of the GeneratePdf overloads to create a new PeachPdfDocument, or one of the AddPdfPages overloads to append rendered pages to an existing one. |
| PdfImage | A reusable, resolve-once image source for the declarative document-building API (CreateDocument(Action<IDocumentBuilder>, PdfGenerateConfig)) - pass the same instance to more than one IContainer.Image(PdfImage) call to place the same image (raster or SVG - the format is detected automatically, same as the other Image/Svg overloads) in multiple places without re-reading/redecoding its source for each placement. Mirrors QuestPDF’s own shared-image API (https://www.questpdf.com/api-reference/image/shared.html): decode/parse once, reuse the resolved result everywhere the same instance is placed. |
| PeachPdfCssContent | An opaque, pre-parsed stylesheet produced by ParseStyleSheet(string, bool). Pass an instance to a GeneratePdf/AddPdfPages overload’s cssData parameter to reuse the same parsed CSS across multiple renders instead of re-parsing identical stylesheet text on every call. |
| PeachPdfDocument | A PDF document produced by PdfGenerator. Instances are created by calling one of the PdfGenerator.GeneratePdf overloads and are written out with Save(Stream). |
| Structs | |
|---|---|
| ClippedWord | One word that was DRAWN into the content stream and then truncated by a clip. |
| PdfBoxShadow | One box-shadow layer for the declarative document-building API (CreateDocument(Action<IDocumentBuilder>, PdfGenerateConfig)). |
| PdfColor | An RGBA color for the declarative document-building API (CreateDocument(Action<IDocumentBuilder>, PdfGenerateConfig)). Deliberately not System.Drawing.PaintColor - that assembly isn’t available/trim-friendly on every target this library supports (WebAssembly, NativeAOT). Internally formats to a canonical rgb()/rgba() CSS color token, resolved by PeachPDF’s own existing CSS color parser at layout time - not a new, independent color implementation. |
| PdfLength | A CSS length or percentage for the declarative document-building API (CreateDocument(Action<IDocumentBuilder>, PdfGenerateConfig)) - every size-shaped parameter there (page size, margins, padding, border width, spacing, column widths, font size) is a PdfLength rather than a raw System.Double. Internally this formats to a canonical CSS length token (e.g. "12pt", "1.5in", "50%") and is resolved by PeachPDF’s own existing CSS length-parsing machinery at layout time - this is not a new, independent unit-conversion implementation. |
| PdfSize | A resolved size in points, handed to a dynamic content callback (a Func<PdfSize,byte[]>/ Func<PdfSize,string> passed to IContainer.Image/IContainer.Svg) so it can generate content at exactly the size the container it’s placed in already resolves to, rather than a guessed fixed size - see those methods’ own doc comments for the size-resolution rules. |
| RuneRange | An inclusive range of Unicode scalar values (codepoints), e.g. the U+0000-00FF of a CSS @font-faceunicode-range descriptor, or the coverage a font declares for a face registered via PdfGenerator’s AddFontFromStream. Both ends are inclusive - unlike System.Range, which is half-open and int/index based - and the endpoints are real System.Text.Runes, so surrogate/out-of-range values can’t be expressed by construction. |
| Enums | |
|---|---|
| ColorBlackGeneration | How to represent an achromatic (gray/black) RGB-authored color as CMYK - see BlackGeneration. |
| ColorConversionMode | How document colors should be converted for output - see ConversionMode. Every non-PreserveAsAuthored mode requires the relevant destination ICC profile property to be set (and parseable) - PdfGenerator validates this at generation time rather than discovering it deep in painting. |
| ColorRenderingIntent | An ICC rendering intent (ICC.1:2010 §7.2.15) - see RenderingIntent. |
| FacturXProfile | The Factur-X / ZUGFeRD profile of the invoice XML embedded in a hybrid invoice (FacturXOptions) - how much of the EN 16931 invoice data model the XML carries. The profiles are nested, each containing the one before it. |
| ImageCompression | How an opaque, lossless raster source is embedded, set via ImageCompression. PNG, BMP, and GIF always qualify (none of the three has a lossy encoding mode at all). WebP, AVIF, and TIFF each support both a lossy and a lossless encoding mode, so a source in one of those formats only qualifies when it was actually encoded losslessly - a lossy-encoded WebP/AVIF/TIFF is unaffected by this setting in every mode and stays on the same JPEG-re-encode path it always used. |
| PageOrientation | Specifies the orientation of a page. |
| PageSize | Identifies the most popular predefined page sizes. |
| PdfAConformance | The PDF/A (ISO 19005) conformance level to target, set via PdfAConformance. Defaults to None - no PDF/A -specific work is done: no /OutputIntents, no forced XMP metadata, no PDF-version bump, no PDF/A-1 transparency rejection, and no accessible-level language/alt-text requirements. |
| PdfAttachmentRelationship | How an embedded file (PdfAttachment) relates to the PDF document it is embedded in - the PDF /AFRelationship entry (ISO 19005-3, ISO 32000-2 §14.13). |
| PdfColorScheme | The color scheme the renderer reports to the CSS prefers-color-scheme media feature (which drives, for example, dark-mode style variants). A static PDF has no user/OS preference, so this is chosen by the caller via PreferredColorScheme; it defaults to Light. |
| PdfLengthUnit | The subset of CSS <length>/<percentage> units meaningful for a declaratively-built print document (see PdfLength). Viewport- and container-query-relative units (vw, cqw, etc.) are deliberately not exposed here - they resolve against a browser viewport/query container, neither of which a declarative document-building call has one of. |
| PdfPermissions | The operations a PDF reader may allow a person who opened an encrypted document with its <em>user</em> password. A person who opens it with the <em>owner</em> password is never restricted. A reader enforces these voluntarily: they are a request made of well-behaved software, not a cryptographic barrier, because anyone who can open the document can read its content. |
| PdfVersion | The PDF version to target for the generated document’s file header (the “%PDF-x.y” marker) and any version-gated features written into it. |
| PdfXConformance | The PDF/X (ISO 15930) conformance level to target, set via PdfXConformance. Defaults to None - no PDF/X-specific work is done. PDF/X is a print-production conformance family (distinct from - and mutually exclusive with - PdfAConformance’s archival family): every non-None level requires an /OutputIntents ICC profile (OutputIntentProfile on ColorOptions - unlike PDF/A, PeachPDF bundles no default profile for this, since there is no single correct press profile to assume). |
| TransparencyPolicy | What to do when a document targeting a conformance level that forbids transparency (PDF/A-1, PDF/X-1a, PDF/X-3) uses a construct that needs it: an opacity below 1, a semi-transparent colour or gradient, an image with an alpha channel, a blend mode, an SVG mask or filter, and so on. See TransparencyPolicy. |