C# Itext7 Using Arabic text

Viewed 561

I need to show some information in Arabic using Itext7 using C#.NET Framework. I used Itext7 to fill many pdf files in english with no problems,but when i used the same method with arabic text the pdf file shows up a blank page can any one please help me. here is my Code:

PdfWriter writer = new PdfWriter(SaveFileDialog.FileName);
PdfDocument pdfDocument = new PdfDocument(writer);
pdfDocument.SetDefaultPageSize(PageSize.A4);
Document document = new Document(pdfDocument);
FontSet fontSet = new FontSet();
fontSet.AddFont("font/NotoNaskhArabic-Regular.tff");
fontSet.AddFont("NotoSansTamil-Regular.ttf");
fontSet.AddFont("FreeSans.ttf");
document.SetFontProvider(new FontProvider(fontSet));
Paragraph arabicHeader = new Paragraph("تجربة تجربة تجربة تجربة");
document.Add(arabicHeader);
document.Close();

Note: the Guide on how to use Itext7 with the Arabic language isn't helpful, https://itextpdf.com/en/products/itext-7/pdfcalligraph.

0 Answers
Related