Skip to content

1.1.0

Choose a tag to compare

@gvreddy04 gvreddy04 released this 18 Nov 07:49
· 56 commits to main since this release
48313f8

Summary

UnlimitedPDF 1.1.0 adds your own fonts and more languages, and extract and remove pages. Load a .ttf or .otf font and write Hindi, Telugu, Tamil, French, and other languages written in Latin letters, each shaped the way its script needs, in every text call and in HTML. Take the pages you want out of a PDF, or leave out the ones you don't, in one call. It also fixes two issues. Code written for 1.0.x works as is, except for one call pattern described under Upgrading from 1.0.x.

dotnet add package UnlimitedPDF --version 1.1.0

What's New

Fonts and languages

  • Your own fonts. PdfFont.FromFile, FromFileAsync, FromStream, FromStreamAsync, and FromBytes load TrueType and CFF fonts, including variable fonts at any weight. PDFs embed only the glyphs they use, and copied or searched text reads back as written.
  • More languages. Devanagari (Hindi and others), Telugu, and Tamil are shaped with the font's own rules: conjuncts, half forms, reph, and vowel signs in place. Latin text gets accents, ligatures, and kerning.
  • Everywhere text goes. PdfPage.AddText, headers and footers, the body flow, flow blocks, table cells (PdfCellText, PdfTable.SetText), and HTML (PdfHtmlLoadOptions.Fonts, matched by CSS font-family, weight, and style).
  • Fallback fonts and missing characters. PdfDocument.FontFallback tries fonts in order for each character, so one line can mix scripts. FindMissingCharacters lists what no font has, and FailOnMissingCharacters makes Save throw PdfTextException instead of drawing ?.

Extract and remove pages

  • Extract pages. PdfOperations.Extract and ExtractAsync write the pages you choose to a new PDF, in the order you give. A page can be chosen more than once.
  • Remove pages. PdfOperations.Remove and RemoveAsync write the PDF without the pages you choose. The pages left keep their order.
  • Page lists as text. PdfPageRange.Parse reads lists such as 2, 5, 7-9 or 9-7, so text your users type can go straight to Extract, Remove, and Split.
  • Small, complete files. Each page keeps its look, the links between kept pages, comments, layers, and its bookmarks, and the file keeps its title, author, and metadata. Each page takes only the fonts and images it uses, so a few pages of a large file make a small file.
  • Chosen pages in your own document. PdfDocument.AddPages(file, ranges, bookmarkTitle) adds the chosen pages under one bookmark.

What's Changed

  • Text drawn without a font now shows Western European characters such as é, ü, €, dashes, and curly quotes instead of ?. Documents with only ASCII text are written exactly as before.
  • HTML reports each character it draws as ? with a MissingCharacter warning (so FailOnWarning fails on it), and reports @font-face as FontFaceIgnored.
  • The package includes THIRD-PARTY-NOTICES.txt, the license of the Unicode data the script tables are built from. It includes no fonts.

What's Fixed

  • Table cell positions, sizes, and border widths are always written as plain decimal numbers. A very small or very large value used to be written as 1E-05, which PDF readers don't accept.
  • Loading a damaged PDF to merge or split stays fast and small. Out-of-range compressed-data settings are reported as a damaged file, and oversized named-destination names are skipped.
  • The package page's readme no longer shows HTML tags as text.

Upgrading from 1.0.x

  • A call that passes null as a page number by position, such as AddPages(file, null, 7), no longer compiles because of the new AddPages overload. Name the argument instead: AddPages(file, lastPage: 7). Apps that are already built keep working.

Demos

The demo site is redesigned. It has a scenario gallery with search and 25 scenarios across finance, HR, legal, healthcare, retail, logistics, and management, with every PDF drawn in the page next to its C# code. New demos include Fonts and languages (an invoice in Hindi, Telugu, Tamil, French, or a mix), Extract pages, and Remove pages.

Links