Skip to content

1.0.0

Choose a tag to compare

@gvreddy04 gvreddy04 released this 12 Nov 19:30
· 145 commits to main since this release
4c9a38d

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

  • PdfFile and PdfFileLoadOptions load existing PDFs; PdfFileException reports files that can't be read.
  • PdfOperations.Merge joins whole files in one call.
  • PdfDocument.AddPages adds page ranges from loaded files next to pages you build.

Split PDFs

  • PdfOperations.Split and PdfOperations.SplitAsync split a PDF every N pages or by PdfPageRange.
  • Each part (PdfSplitPart) is written to a folder or to a stream of your own; PdfSplitException reports problems.

HTML to PDF

  • PdfHtml loads HTML from a string, a file, or a stream, and PdfOperations.ConvertHtml and ConvertHtmlAsync convert it in one call. PdfBodyFlow.AddHtml mixes it with other content.
  • Supports block and inline layout, headings, lists, tables nested to any depth with colspan and rowspan, PNG and JPEG images, <style> and linked stylesheets, clickable links, and headings as bookmarks.
  • Page breaks: rows move to the next page whole, thead rows repeat on every page, and break-before, break-after, break-inside: avoid, and page-break-* are honored.
  • Resources come only from data: URIs, the HTML's own folder, or your ResourceResolver; the library never reads the network or paths outside the base folder.
  • Anything skipped is listed in PdfHtml.Warnings. Set FailOnWarning to throw PdfHtmlException instead, 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, and MarginRight.
  • Filled rectangles with PdfPage.AddRectangle.

Images, colors, and units

  • PdfImage and PdfPage.AddImage for 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.0 target, alongside net6.0, net8.0, net9.0, and net10.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.Text now reads and writes the cell's first text item; text-only cells behave as before.
  • Table cells with VerticalAlignment set to Top or Bottom are 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.AddText checks 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 alt text.
  • Text uses the standard PDF fonts; characters outside Western European, such as Cyrillic, Chinese, and emoji, are written as ?.
  • pre lines don't wrap, so a line wider than the page is clipped; use white-space: pre-wrap to wrap it.

Links