sujith Posted December 22, 2007 Share Posted December 22, 2007 I created pdf using ireport, but hindi font is not displaying correcly in pdfs. Here I am attaching two pdfs, one is created using ireport and other one created using adobe pdf convertor. second one displaying hindi correcly. One difference I noticed is that, if I am creating pdf using ireport it is adding one unwanted font (Helvetica) in pdf. [file name=My_Documents.zip size=11138]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/My_Documents.zip[/file] Post edited by: sujith, at: 2007/12/22 05:03 Post edited by: sujith, at: 2007/12/22 05:04Post edited by: sujith, at: 2007/12/22 05:07 Link to comment Share on other sites More sharing options...
yaramada123 Posted December 22, 2007 Share Posted December 22, 2007 pdf default font is set to Helvetica in the default.jasper.properties file, change it to the font you want to make it work also you can change other properties like default size etc., net.sf.jasperreports.default.pdf.font.name=Helvetica Hope this helps!!! Jagadeesh Link to comment Share on other sites More sharing options...
sujith Posted December 22, 2007 Author Share Posted December 22, 2007 Sorry . it would be helpful if i get more explanation.i'm generating pdf report using ireport 1.2.0. I could not find the properties file u mentioned in the distribution. Can u please help me out ?? sujith Link to comment Share on other sites More sharing options...
yaramada123 Posted December 22, 2007 Share Posted December 22, 2007 Hi, iReports does not contain this property file, iReports uses jasperreports API to fill and export the report. Look for jasperreport jar in the iReports lib directory and this property file will be present in the root folder when you unzip the JAR. All the Best!!! Link to comment Share on other sites More sharing options...
sujith Posted December 24, 2007 Author Share Posted December 24, 2007 Hi, I extracted the jasperreports-1.2.1.jar, but I could't find out the properties file. Hindi is displaying correctly in JR Viewer and Excel. Thanks,Sujith Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 27, 2007 Share Posted December 27, 2007 Hi, Forget about the jasperreports.properties file.You don't need to go that deep. What you need to understand is that when exporting to PDF, you need to specify the fonts to be used in the PDF file and even embed them into the PDF file, unless you rely on Helvetica, which is the default.Helvetica is not good for you, because it does not support Hindi. I'm pretty sure you use the fontName attribute to specify a font that supports Hindi. This is why it works for you in the JR Swing viewer. For PDF, you need to also use the pdfFontName, pdfEncoding and isPdfEmbedded attributes to indicate the TTF file to be used in PDF, the enconding and whether the font should be embedded into the resulting PDF file, in case those who view the PDF do not have the Hindi font installed on their machines or PDF viewers. You should take a closer look at the supplied /demo/samples/unicode sample provided with the project and see how we display Arabic and Hebrew texts that also work in PDF. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
sujith Posted December 27, 2007 Author Share Posted December 27, 2007 I think this is not the problem with ireport. It is the problem with itext which is not supporting indic languages correcly. Plz check the following link. http://itext.ugent.be/library/question.php?id=741 Thanks,Sujith Link to comment Share on other sites More sharing options...
reinerm Posted April 29, 2008 Share Posted April 29, 2008 teodord wrote:What you need to understand is that when exporting to PDF, you need to specify the fonts to be used in the PDF file and even embed them into the PDF file...You should take a closer look at the supplied /demo/samples/unicode sample provided with the project and see how we display Arabic and Hebrew texts that also work in PDF. hello theodor, hello everybody! i have a similar problem with greek letters in a report but i am using "Arial" for fontName and "ARIAL.TTF" for pdfFontName (exactly as in above mentioned unicode sample - which works fine on my system) when trying to generate a PDF using Code:jasperReport = JasperCompileManager.compileReport(reportXML); jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource);...output = JasperExportManager.exportReportToPdf(jasperPrint); in my application sourcecode,i get an exception:Code:[code]net.sf.jasperreports.engine.JRException: Could not load the following font : pdfFontName : ARIAL.TTFpdfEncoding : Identity-HisPdfEmbedded : true... my .jrxml file is located inside a .jar file and i am running my application on a jboss application server - could this be part of the problem? can't figure it out on my own.. please help.. :( thanks in advance,reiner please note: i know it does work when settingCode:[code]pdfFontName="C:WindowsFontsARIAL.TTF"in the jrxml file - but setting hardcoded absolute paths is no option for mePost edited by: reinerm, at: 2008/04/29 15:56 Link to comment Share on other sites More sharing options...
reinerm Posted April 29, 2008 Share Posted April 29, 2008 attached: report file trimmed to the one problematic text field of original report [file name=report-51c37396ad9fa35d92ff5c9451eb56b2.jrxml size=2739]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/report-51c37396ad9fa35d92ff5c9451eb56b2.jrxml[/file] Link to comment Share on other sites More sharing options...
rkvsraman Posted May 5, 2009 Share Posted May 5, 2009 Hi,The problem is that iText does not support OpenType Fonts. We have a workaround. Read the full story here or get the source from here Link to comment Share on other sites More sharing options...
anyone Posted July 22, 2010 Share Posted July 22, 2010 HiFor UTF-8 set pdffontname with path to font.ttf and set ispdfEmbeded=true.It works for me.ThanxAnyOne.<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Mangal" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="C:\Windows\Fonts\Mangal.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now