No native renderer
Pure C# output with no Chromium, wkhtmltopdf, or runtime deployment surprises.
Free, MIT-licensed PDF generation for .NET
TerraPDF is a lightweight, zero-dependency PDF library for invoices, reports, tables, QR codes, barcodes, bookmarks, custom fonts, and encrypted documents.
New release
Column spans, row spans, header-less tables, and tables placed directly in page content now paginate more predictably.
Write the document in a fluent API. TerraPDF lays it out, paginates it, and writes the file.
var brand = "#1A3C5E";
(string Item, string Sku, int Qty)[] lines =
[
("Wireless Mouse - Graphite", "SKU-10231", 24),
("Mechanical Keyboard, 87-key", "SKU-10456", 12),
("USB-C Dock, Dual 4K", "SKU-10877", 6),
("Laptop Stand, Aluminium", "SKU-10920", 18),
];
Document.Create(doc =>
{
doc.Page(page =>
{
page.Size(PageSize.A5);
page.Margin(1.5, Unit.Centimetre);
page.DefaultTextStyle(s => s.FontSize(10));
page.Header().Column(col =>
{
col.Item().Row(row =>
{
row.RelativeItem().AlignMiddle()
.Text("TerraPDF Logistics").Bold().FontSize(13).FontColor(brand);
row.AutoItem().AlignRight()
.Text("PACKING SLIP").Bold().FontSize(20).FontColor(brand);
});
col.Item().LineHorizontal(2, brand);
});
page.Content().PaddingTop(14).Column(col =>
{
col.Spacing(14);
col.Item().Row(row =>
{
row.RelativeItem().Column(shipTo => { /* address block */ });
row.AutoItem().QrCode("https://terrapdf.example/track/ORD-2026-1187", size: 88);
});
col.Item().Table(table =>
{
table.ColumnsDefinition(c =>
{
c.RelativeColumn(5);
c.RelativeColumn(2);
c.RelativeColumn(1);
});
// brand header row + line items
});
col.Item().AlignCenter()
.Barcode("ORD-2026-1187", height: 46, showCaption: true);
});
page.Footer().AlignCenter().Text(t =>
{
t.Span("Page ");
t.CurrentPageNumber();
t.Span(" of ");
t.TotalPages();
});
});
})
.PublishPdf("packing-slip.pdf");
Pure C# output with no Chromium, wkhtmltopdf, or runtime deployment surprises.
Rows, columns, tables, spans, headers, footers, page numbers, and precise spacing.
Images, links, bookmarks, metadata, QR codes, barcodes, custom fonts, and AES-256 encryption.
Start with the guide, then adapt one of the samples for your app.