Closed guymalka closed 3 years ago
For Hebrew
you should use Identity-H
+ RTL tips.
here is the code, very similar to the code in the example you sent i get empty rectangle
var pdfDoc = new Document(PageSize.A4);
var fileStream = new FileStream(@"D:\Test90.Pdf", FileMode.Create);
PdfWriter.GetInstance(pdfDoc, fileStream);
pdfDoc.Open();
var table = new PdfPTable(numColumns: 1)
{
RunDirection = PdfWriter.RUN_DIRECTION_RTL,
ExtendLastRow = true
};
var pdfCell = new PdfPCell(new Phrase("טקסט בעברית", new Font(0, 10)))
{
RunDirection = PdfWriter.RUN_DIRECTION_RTL
};
table.AddCell(pdfCell);
pdfDoc.Add(table);
pdfDoc.Close();
fileStream.Dispose();
Change the new Font(0, 10)
to
var tahomaFont = TestUtils.GetUnicodeFont("Tahoma", TestUtils.GetTahomaFontPath(), 10, Font.NORMAL, BaseColor.Black);
And this is how you should create and cache a Unicode font.
the only way is to write "tahoma" font and use the ttf file ?
Yes. This is how BaseFont.IDENTITY_H
encoding works.
thanks , worked
Summary of the issue
i try to use this with Hebrew text and fail i dont find cp862 for Hebrew , if i use 28598 the program fails
Environment
windows 10
Example code/Steps to reproduce:
var stream = new FileStream(@"D:\Test9.Pdf", FileMode.Create); var document = new Document(PageSize.A4);
Output: