Hi,
I'm having some troubles using hebrew chars inside forms.
when using page.Canvas.DrawString everything is working as it should.
Here's my results PDF - s3.amazonaws.com/nf_forms/-1/IceBlueHeb.pdf
When opening this file from foxit reader everything looks ok, but when opening it from chrome using PDF App, the the Hebrew letters looks in gibberish Here's my code -
var value = "שלום";
PdfDocument doc = new PdfDocument();
PdfPageBase page = doc.Pages.Add(PdfPageSize.A4, new PdfMargins());
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font(@"c:\Alef-Regular.ttf", 16f, FontStyle.Bold), true);
RectangleF labelBounds = new RectangleF(20, 20, 40, font.Height);
page.Canvas.DrawString(value, font, PdfBrushes.Black, labelBounds, new PdfStringFormat() { RightToLeft = true });
PdfTextBoxField tb = new PdfTextBoxField(page, "a")
{
Bounds = new RectangleF(80, 20, 80, font.Height),
Text = value,
Font = font,
ForeColor = Color.Blue
};
doc.Form.Fields.Add(tb);
string file = string.Format("result.pdf", Guid.NewGuid().ToString());
doc.SaveToFile(file);
System.Diagnostics.Process.Start(file);
Thanks,
kfir.