Repository navigation
Summary
UnlimitedPDF 1.2.0 adds right-to-left documents and 13 more scripts. Arabic, Persian, Urdu, Hebrew, Dhivehi, and other right-to-left languages read from the right, with English words, numbers, and brackets in place, and tables that start at the right. Bengali-Assamese, Gujarati, Gurmukhi, Odia, Kannada, Malayalam, Greek, Cyrillic, Armenian, and Georgian join Latin, Devanagari, Telugu, and Tamil, for 17 scripts in all. Code that works with 1.1.x compiles and runs as is, and left-to-right text keeps its direction and alignment.
dotnet add package UnlimitedPDF --version 1.2.0
What's New
- Right-to-left documents. Set
PdfDocument.TextDirection = PdfTextDirection.RightToLeftonce. Text starts at the right edge, and a right-to-left table draws its first column at the right. Override the direction for one call with aPdfTextOptionsargument, for one table withPdfTable.Direction, or for one cell withPdfCellText.Direction. - The Unicode Bidirectional Algorithm (Unicode 17.0.0) orders each line, so Latin words, numbers, and brackets inside Arabic or Hebrew read correctly. Copy, search, and read-aloud return the text in reading order.
- Arabic, Hebrew, and Thaana shaping. Arabic-script letters take their joined forms, required ligatures such as Lam with Alef, their marks, and the cursive attachment Nastaliq fonts use. Persian, Urdu, Pashto, Sorani, Sindhi, Uyghur, and Jawi letters are covered. Hebrew points and Thaana vowel signs sit on their letters.
- Start and End alignment (
PdfTextAlignment,PdfCellHorizontalAlignment) follow the text's direction. - Direction in HTML. The
dirattribute (ltr,rtl,auto), CSSdirection,<bdi>, and<bdo>set direction;text-align: startandend, table columns, and list markers follow it. - Ten more scripts. Bengali-Assamese, Gujarati, Gurmukhi, Odia, Kannada, and Malayalam are shaped with the font's own rules, and Greek, Cyrillic, Armenian, and Georgian each use their own script's font rules.
What's Changed
- Every alignment default is
Startinstead ofLeft. Left-to-right text draws byte for byte as before, and right-to-left text lands at the right edge without an argument. - Devanagari, Telugu, and Tamil use the same OpenType Indic rules as the new scripts, so some Hindi and Telugu words with a reph or below-base forms draw differently from 1.1.0.
- HTML
text-transformfollows thelangattribute for Turkish and Azerbaijani (istanbulin uppercase isİSTANBUL), and uppercase turns dotlessıintoIin every language. - Right-to-left letters of scripts that aren't shaped, such as Syriac and N'Ko, are reported as missing characters even when the font has them; bidirectional marks and controls are no longer reported.
- The package's copyright holder is Vikram Reddy, and its release notes link the changelog.
Known limits
Right-to-left scripts other than Arabic, Hebrew, and Thaana aren't shaped. Chinese, Japanese, and Korean aren't supported. HTML unicode-bidi is ignored, and Arabic is justified by widening spaces, not by stretching letters.
Demos
The demo site adds a Right-to-left documents demo (Arabic, Persian, Urdu, Hebrew, and Dhivehi invoices, drawn with text calls or HTML), 24 languages and a mixed-script invoice in the Fonts and languages demo, six free PDF tools that run on your own files in the browser, and a PDF and C# code view with a complete console program for every demo.
Links
- NuGet: https://www.nuget.org/packages/UnlimitedPDF/1.2.0
- Live demo: https://unlimitedpdf.dev/playground/languages/right-to-left-documents
- Fonts and languages guide: https://github.com/unlimited-docs/UnlimitedPDF/blob/main/docs/guides/fonts-and-languages.md
- Changes in 1.2.0: https://github.com/unlimited-docs/UnlimitedPDF/blob/main/CHANGELOG.md#120
- Full changelog: v1.1.0...v1.2.0