60-second quickstart
Install the package, draw on a page, save the bytes.
dotnet add package JetsonPDF.Writer
using JetsonPDF;
var doc = new Document { Title = "Hello" };
var page = doc.AddPage(PageSize.Letter);
page.DrawText("Hello, PDF!",
new Font(FontFamily.Helvetica, 24),
x: 72, y: 700);
doc.Save("hello.pdf");
That's a complete, valid PDF 2.0 file — no native dependencies, no
layout engine to wire up, just C# you can drop into any .NET 8 project.
Pick your level
Three layered authoring APIs ship in the box. Drop down to the Writer for direct byte control, stay in the middle with Fluent, or model a whole document with Flow.
Fluent — layout DSL
QuestPDF-style API. Compose pages from header, footer, and content slots; rows, columns, and tables; per-run rich text with live page numbers.
using JetsonPDF;
using JetsonPDF.Fluent;
FluentDocument.Create(d => d.Page(p =>
{
p.Size(PageSize.Letter);
p.Margin(50);
p.Header().AlignRight().Text(t =>
{
t.Span("Page ");
t.CurrentPageNumber().Bold();
t.Span(" / ");
t.TotalPages().Bold();
});
p.Content().Column(col =>
{
col.Spacing(8);
col.Item().Text("Invoice", s =>
{
s.FontSize = 24;
s.FontStyle = FontStyle.Bold;
s.FontColor = Colors.IndigoDark;
});
col.Item().Text("Bill to: Acme Corporation");
});
})).GeneratePdf("invoice.pdf");
Fluent API reference (PDF) · Full invoice example
Flow — Word-style DOM
Mutable retained-mode tree. FlowDocument → Section → Paragraph/Table with named styles, footnotes, hyphenation, and an auto-built TOC.
using JetsonPDF;
using JetsonPDF.Flow;
var doc = new FlowDocument { Title = "Quarterly Report" };
var s = doc.AddSection();
s.PageSize = PageSize.Letter;
s.PageMargins = new Margins(72);
s.Body.Add(new Paragraph("Introduction")
{ Style = ParagraphStyle.Heading1 });
s.Body.Add(new Paragraph(p =>
{
p.AddText("Revenue grew ");
p.AddText("12%").Bold();
p.AddText(" year over year");
p.AddFootnote("Constant-currency basis.");
p.AddText(".");
}) { Alignment = TextAlignment.Justify });
doc.Save("report.pdf");
Flow API reference (PDF) · Full report example
API reference PDFs
Every public namespace ships with a generated, paginated reference doc — built by JetsonPDF itself:
Rendered output
Open these PDFs to see what JetsonPDF actually produces:
Why JetsonPDF
Built from spec
Implemented directly against ISO 32000-2:2020 — COS objects,
xref streams, content-stream operators, the lot. No third-party PDF
engine sits in between you and the bytes.
No magic dependencies
Targets .NET 8. Two NuGet dependencies total: code-pages
(WinAnsi) and the BCL's PKCS#7 stack. Everything else —
fonts, filters, images, encryption — is in-tree.
Reader + Writer + Forms + XAML
Read any PDF into a typed object model, write a fresh one from your
own model, fill existing AcroForms with
JetsonPDF.Forms, or round-trip through XAML via the
JetsonPDF.Wpf (desktop) and
JetsonPDF.OpenSilver (WebAssembly) adapters.
Symmetric APIs, shared types.
Production conformance
Declare PDF/A-1b, 2, 3 or PDF/UA-1, 2 and have the validator check it.
Add invisible PKCS#7 signatures, DocTimeStamps, and a
DSS/VRI catalog for PAdES B-LTA.
Capabilities at a glance
Writer
- Standard 14 + embedded TrueType + Type 3 fonts
- Vector paths, images, Form XObjects, transparency
- Axial / radial / function / mesh shadings
- Tiling patterns (coloured + uncoloured)
- Object & xref streams, linearization, incremental updates
Annotations & forms
- Every §12.5.6 subtype: link, markup, FreeText, geometric, file attachment, redact, sound, popup, caret, stamp
- AcroForm widgets: text, check, radio, combo, list, button, signature, barcode
/AA field actions and /CO calculation order
Forms (editing)
Form.Open — discover, modify, save existing AcroForms
- Type-safe
SetText / SetChecked / SelectRadio / SetChoice
SetImage bakes /AP /N on text fields, push buttons, unsigned /FT /Sig
- Single-layer incremental saves — byte-identical across repeated
Save()
- Round-trips encrypted PDFs without re-keying
Composition
PageExtractor.Extract — pull 1-based pages into a new PDF (reorder + duplicate)
Merger.Merge — concatenate whole PDFs into one
- Lossless COS copy — no re-render, no generational loss
- Outlines, named dests, AcroForm fields carry over with collision handling
Reader
Reader.Load → full ReadDocument tree
- Outlines, page labels, named dests, viewer prefs, OCGs, structure tree
- Filters: Flate, DCT, LZW, ASCII85/Hex, CCITT G3 1D + 2D, JBIG2 (arithmetic + Huffman), JPX
Security
- AES-128 + AES-256, full permission bits
- PKCS#7 detached signatures (visible & invisible)
- DocTimeStamp, FieldMDP, DocMDP
- DSS / VRI catalog for PAdES B-LTA
Conformance
- PDF 2.0 header, object streams, xref streams
- Tagged PDF: nested structure, role + class maps,
/Lang, /Alt, /ActualText
- PDF/A-1b/2/3 + PDF/UA-1/2 declaration and validator
WPF integration
PdfToXamlConverter — render any PDF as a XAML tree
XamlToPdfConverter — live WPF layout, then emit PDF
<jetsonpdf:Document> + multi-page authoring with {jetsonpdf:PageNumber}
jetsonpdf:Form.* attached props for AcroForm widgets
OpenSilver integration
JetsonPDF.OpenSilver — same authoring dialect, running in WebAssembly
PdfToXamlConverter + XamlToPdfConverter on netstandard2.0 — no WPF, no STA, no Windows
- Same
<jetsonpdf:Document>, AcroForm widgets, {jetsonpdf:Base64Image}, {jetsonpdf:PageNumber}
- Runs in a Wasm browser app, a WebView2 simulator, or a Playwright-driven Chromium CLI
PDFML markup
.pdfml — declarative, prefix-free XML for PDFs with WPF-style layout and {Binding} data binding
PdfmlRenderer.Render(pdfml, data) — runtime-independent (no WPF, browser, or STA)
<PdfmlView> — a live, data-bound control for WPF + OpenSilver
- Visual Studio extension: schema IntelliSense + live PDF preview
Read the PDFML guide →
PDF → TIFF
PdfToTiffConverter — rasterize any PDF to a multipage TIFF
- DPI, colour mode, compression, page subset, one-file-per-page
PdfToTiffBrowserConverter — same job in WebAssembly, no server
JetsonPDF.Tiff — standalone managed TIFF reader + writer
Fluent layout DSL
FluentDocument.Create(d => d.Page(...)) — QuestPDF-style API
- Header / Footer / Background / Foreground / Content slots
Column / Row / Table with row span, column span, repeating header, last-page footer
- Two-pass renderer resolves
{TotalPages} after layout
- Form widgets via
.AsTextField / .AsCheckBox / .AsComboBox / .AsPushButton
Flow document model
- Word-like retained-mode DOM —
FlowDocument → Section → Paragraph/Table
- Named styles with
BasedOn; built-in Heading1..3 / Quote / Caption
- Footnotes, endnotes, comments, drop caps, anchored images
- Auto-built
TableOfContents, EndnoteList, CommentList
- Liang-pattern hyphenation; track-changes runs (
AsInsertion/AsDeletion)
Full feature list →
Examples →
Where it shines
Document compliance. If you ship invoices, contracts, or
regulated reports, JetsonPDF is built to make PDF/A and PDF/UA declarations
verifiable. doc.Validate() returns a list of
ConformanceIssue entries; flip ThrowOnConformanceError
to fail your build pipeline before a non-conformant file ever ships.
Long-term archival signatures. Sign a document, add a
timestamp from any RFC 3161 TSA, then write a DSS/VRI catalog with the
certs, CRLs, and OCSP responses inline — PAdES B-LTA in roughly
thirty lines of C#.
WPF- and OpenSilver-native authoring. Compose your document with the
WPF layout engine you already know — on the desktop, or in the browser via OpenSilver.
Grid,
StackPanel,
DockPanel,
Border, data-bound
TextBlocks and
a
PaginatedTable that overflows across pages all "just work."
Read the WPF guide → ·
Read the OpenSilver guide →