Zorg.Pdf
0.5.0
dotnet add package Zorg.Pdf --version 0.5.0
NuGet\Install-Package Zorg.Pdf -Version 0.5.0
<PackageReference Include="Zorg.Pdf" Version="0.5.0" />
<PackageVersion Include="Zorg.Pdf" Version="0.5.0" />
<PackageReference Include="Zorg.Pdf" />
paket add Zorg.Pdf --version 0.5.0
#r "nuget: Zorg.Pdf, 0.5.0"
#:package Zorg.Pdf@0.5.0
#addin nuget:?package=Zorg.Pdf&version=0.5.0
#tool nuget:?package=Zorg.Pdf&version=0.5.0
Zorg.Pdf
Async-first PDF generation for .NET 10, written in C# only, with no native binaries and no dependencies. Native AOT and trimming work.
Pre-release: the API will change before 1.0.
- Build documents in C# or as JSON (with a published JSON Schema), validate them, and render them as tagged PDF that passes veraPDF PDF/UA-1, and PDF/A-2 or PDF/A-3 for archiving.
- Headings, paragraphs with bold, italic and fallback fonts, lists, tables with rows from
IAsyncEnumerable<T>, JPEG and PNG images, headers and footers with "Page X of Y", watermarks, and text boxes for window-envelope addresses (DIN 5008, Norwegian). - Documents that navigate: bookmarks from headings, links, tables of contents, sections with roman or lettered page numbers.
- Templates: values, repeated blocks and table rows bound from a JSON model.
- Charts (bar, stacked, line, pie) and barcodes (QR, Code 128, GS1-128, EAN-13) drawn as vectors; EPC payment QR payloads and Norwegian KID check digits.
- Existing PDFs: read any PDF's pages and metadata, put a page of letterhead behind every page, merge, extract and split, attach files (PDF/A-3), and read files that are encrypted but open without a password.
- Pages stream to the output while later pages are laid out. Output is deterministic: the same document, data and font give the same bytes on every OS.
- Every problem is a diagnostic with a stable code and a JSON pointer, and errors stop a render before the first byte.
Add-on packages: Zorg.Pdf.Imaging (more image formats, page previews), Zorg.Pdf.Hyphenation, Zorg.Pdf.Markdown, Zorg.Pdf.AspNetCore (streaming PDF responses), Zorg.Pdf.Extensions.AI (tools for AI agents), and the zorg-pdf command-line tool (Zorg.Pdf.Tool).
Quick start
using Zorg.Pdf;
using Zorg.Pdf.Fonts;
var invoice = new PdfDocument("Invoice 2026-0042")
{
Footer = new PageBand([new Paragraph(["Page ", Field.PageNumber, " of ", Field.PageCount]) { Align = TextAlign.Right }]),
Content =
[
new Heading("Invoice 2026-0042"),
new Paragraph(["Payment is due within ", new TextRun("30 days") { Style = TextStyle.Bold }, "."]),
new Table([new Column("Description") { Width = ColumnWidth.Star(4) }, new Column("Amount") { Align = TextAlign.Right }])
{
Rows = TableRows.Bound("lines"),
},
],
};
var options = new RenderOptions
{
Fonts = FontCollection.Empty.Add(new FontFamily("Inter")
{
Regular = FontSource.FromFile("Inter-Regular.ttf"),
Bold = FontSource.FromFile("Inter-Bold.ttf"),
}),
Data = PdfData.Empty.WithRows("lines", repository.StreamLinesAsync(id), line => [line.Description, line.Amount.ToString("N2")]),
Conformance = PdfConformance.PdfUA1,
};
await invoice.RenderAsync(response.Body, options, cancellationToken);
The same document as JSON is invoice.ToJson(); read one with PdfDocument.ParseJson, and data with PdfData.ParseJson.
Existing files:
PdfFileInfo info = PdfFileInfo.Read(bytes); // pages, sizes, title, tagged, encrypted
await PdfFiles.MergeAsync([new PdfPageSource(cover), new PdfPageSource(contract) { Pages = "2-" }], output);
var letter = document with { Background = new PageBackground(ImageSource.FromSlot("letterhead")) { OtherPages = 2 } };
Documentation
- Example documents, with their data
- Diagnostic codes
- Known limits
- Changelog
- Report a security problem
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Zorg.Pdf:
| Package | Downloads |
|---|---|
|
Zorg.Pdf.Imaging
Image handling for Zorg.Pdf built on Zorg.Imaging: WebP, GIF, BMP and TIFF, EXIF orientation, sRGB conversion, and photos shrunk to the resolution they're printed at. |
|
|
Zorg.Pdf.Extensions.AI
Tools for AI agents that write PDF documents with Zorg.Pdf: the document schema, validation with JSON pointers, and rendering, as Microsoft.Extensions.AI functions. |
|
|
Zorg.Pdf.Invoicing
Factur-X and ZUGFeRD e-invoices with Zorg.Pdf: the invoice's CII XML embedded in a tagged PDF/A-3, with the profile read from the XML and the metadata e-invoice software looks for. |
|
|
Zorg.Pdf.Hyphenation
Hyphenation for Zorg.Pdf: Liang's patterns for English, German, French, Norwegian and Danish, from the hyph-utf8 project, so justified and narrow text breaks words where the language allows. |
|
|
Zorg.Pdf.Markdown
Markdown to Zorg.Pdf documents: headings, emphasis, lists, tables, code, quotes, images and links from CommonMark and GitHub-flavoured Markdown, rendered as tagged, accessible PDF. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.0 | 52 | 11/15/2026 |
| 0.1.0-preview.1 | 59 | 11/15/2026 |