Repository navigation
1.0.0
Summary
UnlimitedPDF 1.0.0 is the first stable release of the pure .NET PDF library. Beyond creating PDFs with text and tables, it can now merge and split existing PDFs, convert HTML to PDF with its own renderer, continue tables across pages, add headers, footers, and page numbers, and place JPEG and PNG images. It targets .NET 6, 8, 9, 10, and 11, has no third-party dependencies, and runs anywhere .NET runs, including Blazor WebAssembly.
1.0.0 also renames part of the public API so that names follow one convention. Code written for 0.0.x needs the new names. See Upgrading from 0.0.x.
dotnet add package UnlimitedPDF --version 1.0.0
Highlights
- Merge PDFs: load existing PDFs and join whole files in one call, or add page ranges next to pages you build.
- Split PDFs: split every N pages or into one file per page range, to a folder or to a stream per part.
- HTML to PDF: CSS, nested tables and lists, images, and links, with a built-in renderer that never uses the network.
- Tables across pages: tables continue on new pages, with repeated header rows.
- Headers, footers, and body flow: page numbers such as "Page {page} of {pages}", and content that adds pages as needed.
- Images: JPEG and PNG, also inside table cells.
- .NET 11 support, alongside .NET 6, 8, 9, and 10.
- Live demos: try every feature in your browser at https://unlimitedpdf.dev/, with the code behind each demo.
What's New
Merge PDFs
PdfFileandPdfFileLoadOptionsload existing PDFs;PdfFileExceptionreports files that can't be read.PdfOperations.Mergejoins whole files in one call.PdfDocument.AddPagesadds page ranges from loaded files next to pages you build.
Split PDFs
PdfOperations.SplitandPdfOperations.SplitAsyncsplit a PDF every N pages or byPdfPageRange.- Each part (
PdfSplitPart) is written to a folder or to a stream of your own;PdfSplitExceptionreports problems.
HTML to PDF
PdfHtmlloads HTML from a string, a file, or a stream, andPdfOperations.ConvertHtmlandConvertHtmlAsyncconvert it in one call.PdfBodyFlow.AddHtmlmixes it with other content.- Supports block and inline layout, headings, lists, tables nested to any depth with
colspanandrowspan, PNG and JPEG images,<style>and linked stylesheets, clickable links, and headings as bookmarks. - Page breaks: rows move to the next page whole,
theadrows repeat on every page, andbreak-before,break-after,break-inside: avoid, andpage-break-*are honored. - Resources come only from
data:URIs, the HTML's own folder, or yourResourceResolver; the library never reads the network or paths outside the base folder. - Anything skipped is listed in
PdfHtml.Warnings. SetFailOnWarningto throwPdfHtmlExceptioninstead, and size limits keep hostile input in check.
Page layout
- Tables continue on new pages when they pass the bottom margin (
PdfDocument.MarginTop,MarginBottom,PdfTable.HeaderRowCount,PdfTable.RepeatHeaderRows). Tables that fit their page are drawn exactly as before. - Headers, footers, and body flow:
PdfDocument.Header,Footer,Body,BodyMarginTop,BodyMarginBottom,AddPageSettings,MarginLeft, andMarginRight. - Filled rectangles with
PdfPage.AddRectangle.
Images, colors, and units
PdfImageandPdfPage.AddImagefor JPEG and PNG; images and stacked content in table cells; row height modes (PdfRowHeightMode).- Colors from 0–255 channels or hex:
PdfColor.FromRgb(0, 172, 140),PdfColor.FromHex("#002A73"). - Unit conversion with
PdfUnits.
Platforms
- New
net11.0target, alongsidenet6.0,net8.0,net9.0, andnet10.0.
What's Changed
Breaking: renamed API
Every public type is now in the UnlimitedPDF namespace, so using UnlimitedPDF; is the only using you need. Old names are removed, so 0.0.x code reports compile errors until it uses the new names. Generated PDFs are unchanged.
Fixes and behavior changes
PdfCell.Textnow reads and writes the cell's first text item; text-only cells behave as before.- Table cells with
VerticalAlignmentset toToporBottomare now drawn that way (it had no effect before). - Text containing a backslash or an unbalanced parenthesis is now escaped wherever it appears, so it displays as written.
- Table numbers are written the same way in every culture, so documents saved under comma-decimal cultures are valid.
PdfPage.AddTextchecks its input.
Package and docs
- New package readme with an example and a screenshot for every feature, a release-notes summary, and new tags.
- The package's project URL is now https://unlimitedpdf.dev/.
Upgrading from 0.0.x
| 0.0.x name | 1.0.0 name |
|---|---|
using UnlimitedPDF.Enums;, using UnlimitedPDF.Models.Table;, using UnlimitedPDF.Extensions; |
delete them (types are in UnlimitedPDF) |
PdfPageBuilder |
PdfPage |
PdfTableRow |
PdfRow |
PdfTableColumn |
PdfColumn |
PdfTableCell |
PdfCell |
PdfPageBuilder.AddText(string text, int x, int y, int fontSize, string fontName) |
PdfPage.AddText(string text, double x, double y, double fontSize = 12) (no font name; there is one font) |
PdfTable.ColCount |
PdfTable.ColumnCount |
PdfTable.TrimEmptyTrailingRowsAndCols() |
PdfTable.TrimEmptyTrailingRowsAndColumns() |
PdfTable.EnsureSize(rows, cols) |
PdfTable.EnsureSize(rows, columns) |
col parameter of PdfTable.GetCell, GetOrCreateCell, SetCell, SetText |
column (only named arguments change) |
new PdfTableRow(index, initialCols) |
new PdfRow(index, initialColumns) |
colIndex parameter of PdfTableRow.GetCell, SetCell |
columnIndex (only named arguments change) |
PdfTableCell.Background |
PdfCell.BackgroundColor |
PdfTableCell.ColSpan |
PdfCell.ColumnSpan |
PdfTableCell.HAlign / VAlign |
PdfCell.HorizontalAlignment / VerticalAlignment |
PdfTableCell.TopBorder, BottomBorder, LeftBorder, RightBorder |
PdfCell.BorderTop, BorderBottom, BorderLeft, BorderRight |
PdfTable.GetEffectiveColumnWidths(), NormalizeSpans(), IsSameSpanCell(...) |
removed (internal layout helpers) |
PdfPageSize.ToMediaBoxString() |
removed; use ToDimensions() for the size in points |
Known limitations (HTML to PDF)
- Flexbox and grid items are laid out as stacked blocks; floats and positioning are ignored.
- Background images are skipped (background colors are drawn).
- Images other than PNG and JPEG, such as SVG and WebP, show their
alttext. - Text uses the standard PDF fonts; characters outside Western European, such as Cyrillic, Chinese, and emoji, are written as
?. prelines don't wrap, so a line wider than the page is clipped; usewhite-space: pre-wrapto wrap it.
Links
- NuGet: https://www.nuget.org/packages/UnlimitedPDF/1.0.0
- Live demos: https://unlimitedpdf.dev/
- Documentation: https://github.com/unlimited-docs/UnlimitedPDF#readme
- Full changelog: v0.0.3...v1.0.0