Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Dec 08, 2015 7:38 am

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.

[email protected]
 
Posts: 2
Joined: Wed Nov 11, 2015 12:56 pm

Tue Dec 08, 2015 8:58 am

Hi kfir,

Thanks for your inquiry.
I have forwarded your issue to our dev team. We will tell you when it is resolved.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Wed Dec 09, 2015 4:04 pm

Thanks,
Can you just tell me if it's a bug on your side or i'm using it wrong?

[email protected]
 
Posts: 2
Joined: Wed Nov 11, 2015 12:56 pm

Thu Dec 10, 2015 2:01 am

Hi kfir,

Our dev team still do investigation for it, now the cause of the issue has not been found, sorry. We will inform you when there is any update.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Mon Dec 14, 2015 8:18 am

Hi kfir,

Thanks for waiting.
Our dev team has finished the investigation for the issue. The issue was caused by Chrome browser itself.
We also used Adobe to generate the same pdf file, it also had this issue.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron