Repository navigation
1.1.0
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, andFromBytesload 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 CSSfont-family, weight, and style). - Fallback fonts and missing characters.
PdfDocument.FontFallbacktries fonts in order for each character, so one line can mix scripts.FindMissingCharacterslists what no font has, andFailOnMissingCharactersmakesSavethrowPdfTextExceptioninstead of drawing?.
Extract and remove pages
- Extract pages.
PdfOperations.ExtractandExtractAsyncwrite the pages you choose to a new PDF, in the order you give. A page can be chosen more than once. - Remove pages.
PdfOperations.RemoveandRemoveAsyncwrite the PDF without the pages you choose. The pages left keep their order. - Page lists as text.
PdfPageRange.Parsereads lists such as2, 5, 7-9or9-7, so text your users type can go straight toExtract,Remove, andSplit. - 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 aMissingCharacterwarning (soFailOnWarningfails on it), and reports@font-faceasFontFaceIgnored. - 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
nullas a page number by position, such asAddPages(file, null, 7), no longer compiles because of the newAddPagesoverload. 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
- NuGet: https://www.nuget.org/packages/UnlimitedPDF/1.1.0
- Live demos: https://unlimitedpdf.dev/
- Changes in 1.1.0: https://github.com/unlimited-docs/UnlimitedPDF#changes-in-110
- Full changelog: v1.0.1...v1.1.0