v1.0.1 · net8.0 · net9.0 · net10.0 · net11.0 · Windows, macOS, Linux
PDFs in .NET, without the plumbing
Create, lay out, read, render, sign, and manage PDF files through one fluent API — with five proven libraries doing the heavy lifting underneath.
dotnet add package NetPdfKitusing NetPdf.Fluent;
Document.Create(doc => doc
.Page(page => page
.Size(PageSizes.A4)
.Margin(50)
.Header(h => h.Text("ACME Quarterly Report"))
.Content(c => c
.Padding(10)
.Column(column =>
{
column.Spacing(8);
column.Item().Text("Body text wraps and flows across pages automatically.");
column.Item().Row(row =>
{
row.ConstantItem(120).Text("Label");
row.RelativeItem().Text("Value that takes the remaining width");
});
}))
.Footer(f => f.AlignCenter().PageNumber("Page {number} of {total}"))))
.Save("report.pdf");One package, the whole lifecycle
The same document model carries a file from creation through to a verified signature.
Content is measured and paginated automatically — headers and footers repeat, page numbers resolve.
using NetPdf.Fluent;
Document.Create(doc => doc
.Page(page => page
.Size(PageSizes.A4)
.Margin(50)
.Header(h => h.Text("ACME Quarterly Report"))
.Content(c => c
.Padding(10)
.Column(column =>
{
column.Spacing(8);
column.Item().Text("Body text wraps and flows across pages automatically.");
column.Item().Row(row =>
{
row.ConstantItem(120).Text("Label");
row.RelativeItem().Text("Value that takes the remaining width");
});
}))
.Footer(f => f.AlignCenter().PageNumber("Page {number} of {total}"))))
.Save("report.pdf");Five proven libraries. One API.
NetPdf doesn't reimplement PDF. It wraps battle-tested, permissively-licensed libraries behind a single coherent document model — so you learn one surface instead of five, and never wire them together yourself.
Everything a PDF has to do
From a one-page receipt to a signed, accessible, PDF/A-conformant report.
Automatic layout
A measure/draw element tree paginates content for you. Headers and footers repeat; {number} and {total} resolve per page.
Tables & rich text
Fixed and relative columns, cell spans, repeating header rows, mixed inline styles, hyperlinks, and lists.
Read anything
Extract text per page or whole-document, pull embedded images as PNG bytes, and read or write metadata.
Render to images
Rasterize any page to PNG at a chosen DPI through PDFium — previews, thumbnails, and visual regression tests.
AES-256 encryption
Password-protect documents, reopen protected files, and strip encryption again. RC4-128 stays available for legacy readers.
Digital signatures
Detached PKCS#7 signatures from any X.509 certificate, written as an incremental update, with verification built in.
Tagged PDF & PDF/A
A real structure tree with headings, paragraphs, and alt text, plus PDF/A output intent and identification XMP.
Barcodes, SVG, canvas
QR codes, Code128 and friends, SVG rasterization, and raw canvas drawing — all through the same image pipeline.
See it as you build it
Swap .Save() for .ShowInPreviewer() and run under dotnet watch. The previewer window re-renders on every rebuild, and generation errors land in an error panel instead of killing the loop.
using NetPdf.Fluent;
using NetPdf.Previewer;
Document.Create(doc => doc
.Page(page => page
.Content(c => c.Text("Hello, previewer!"))))
.ShowInPreviewer(); // instead of .Save()/.ToBytes() while designing