Last post Aug 19, 2015 03:16 PM by vardhineedi
Aug 16, 2015 05:59 AM|vardhineedi|LINK
i have multi langues web site. i want to convert one html page to PDF.i had done conversion (using itextsharp ) but it shown in English only, i want selected langue. can you please help any one.....
Aug 16, 2015 10:43 AM|Rion Williams|LINK
ITextSharp is going to fairly ignorant and will only translate exactly what it is given, so if the contents of the page is in English, it would output your PDF in English as well. You would likely need to allow the user to choose a specific language prior
to exporting the page to PDF so that you could use that to target how you should output the PDF (e.g. target a specific language version of the page within your code-behind when generating the PDF).
Does that make sense?
Aug 16, 2015 01:35 PM|vardhineedi|LINK
My target as the specified language is not getting as output (EG:- here html is having 2 languages and text in chines or another languages is not displaying only it showing in English)
Aug 16, 2015 11:08 PM|Rion Williams|LINK
If I understand you correctly, your non-English characters are simply not being output properly? If that the case then this may be an issue of encoding or Unicode support. You could try using a
suggestion similar to this one of setting the Identity_H flag on your BaseFont for the document prior to outputting it :
// Define your font and set it properly
iTextSharp.text.pdf.BaseFont font = iTextSharp.text.pdf.BaseFont.CreateFont("path/to/your/font",iTextSharp.text.pdf.BaseFont.IDENTITY_H,iTextSharp.text.pdf.BaseFont.EMBEDDED);
And use that font when outputting any text within your page.
Aug 19, 2015 03:16 PM|vardhineedi|LINK
i try this working fine thanks Rion