Free Support Forum - aspose.com

Converting hebrew website url to PDF


#1

Hi


I’m trying to convert a single page in my website into PDF,
my website is written with hebrew fonts,
the PDF which was created with ASPOSE.PDF contains reversed hebrew strings.

URL for an example:

https://businessinfo.leumi-card.co.il/NotRegistered/Login/BusinessLogin.aspx

PDF which was created is attached to this Message.

i’m using this code to generate this:

WebClient client = new WebClient();<o:p></o:p>

Console.WriteLine("loading url");

Stream stream = client.OpenRead(@"https://businessinfo.leumi-card.co.il/NotRegistered/Login/BusinessLogin.aspx");

StreamReader sr = new StreamReader(stream);

string str = sr.ReadToEnd();

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();

Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

//pdf.IsRightToLeft = true;

//pdf.IsRtlInSegmentMode = true;

Aspose.Pdf.Generator.Text text = new Aspose.Pdf.Generator.Text(section, str);

text.IsHtmlTagSupported = true;

text.TextInfo.IsUnicode = true;

text.TextInfo.FontName = "Arial Unicode MS";

section.Paragraphs.Add(text);

pdf.HtmlInfo.ImgUrl = @"https://businessinfo.leumi-card.co.il";

Console.WriteLine("saving pdf");

pdf.Save(@"c:\guy.pdf");


best regards,
guy bertental

#2

Hi Guy,


Thanks for your inquiry. Please use IsRightToLeft propertly of TextInfo. Hopefully it will fix the issue. If issue persist then please verify the URL as in our attempt to test the scenario we are unable to access stated URL.

// display RTL text accordingly
text.TextInfo.IsRightToLeft = true;

Please feel free to contact us for any furhter assistance.

Best Regards,

#3

Hi


I tried this, i’m afraid it doesn’t work…

Best Regards,
Guy

#4

Hi Guy,


We are sorry for the inconvenience caused. As requested above, please share a sample working URL for Hebrew website, as we are unable to open your shared sample link. So we will investigate the issue further.

Best Regards,