partha99 Posted December 6, 2007 Share Posted December 6, 2007 We are using Unicode font, fetching data frompostgres and displaying through iReport. I have set pdf fontname='Lohit Tamil', font name ='lohit tamil', and Pdf encoding as Identity-H(unicode with Horizontal writing)I have tried with iReport-1.2.0 and iReport-2.0.2 versions. The report is coming properly in JRViewer, Firefox etc. butdisplay is not proper in pdf I need a solution. Partha Link to comment Share on other sites More sharing options...
itchytoes Posted December 8, 2007 Share Posted December 8, 2007 Hi -- Have you tried setting isPdfEmbedded=true so that the font is included with your PDF file? betty Link to comment Share on other sites More sharing options...
partha99 Posted December 10, 2007 Author Share Posted December 10, 2007 Yes. I have set isPdfEmbedded=true. Link to comment Share on other sites More sharing options...
itchytoes Posted December 11, 2007 Share Posted December 11, 2007 Hi -- Are you using a font file , and if so, what is it called? I've been able to use the unicode fonts fromARIALUNI.TTF without any problems. I set pdfFontName="ARIALUNI.TTF" pdfEncoding="Identity-H" and isPdfEmbedded="true". Betty Link to comment Share on other sites More sharing options...
itchytoes Posted December 11, 2007 Share Posted December 11, 2007 Hi -- I downloaded a freebie Akshar.ttf font file from some site and tried it out with the FirstJasper.jrxml sample and it works fine. I specify pdfFontName="Akshar.ttf" and put the Akshar.ttf in the classpath Betty Link to comment Share on other sites More sharing options...
partha99 Posted December 11, 2007 Author Share Posted December 11, 2007 I have used lohit_ta.ttf font which is a tamil unicode font. I have included the font folder in the classpath. [file name=districtrep.jrxml size=3869]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/districtrep.jrxml[/file] Post edited by: partha99, at: 2007/12/11 05:23Post edited by: partha99, at: 2007/12/11 05:25 Link to comment Share on other sites More sharing options...
itchytoes Posted December 12, 2007 Share Posted December 12, 2007 Hi - I looked at your uploaded example, and I tried something very similar to imitate it with the FirstJaspser sample but it worked for me (using my Akshar.ttf font file) So, what do you see instead of the correct Tamil characters? Here's what I suggest trying as an experiment. Instead of printing your $F{dist_name_t} data, just put the string "u0b90u0bb0" which are two valid unicde Tamil characters. See if they appear correctly. Betty Link to comment Share on other sites More sharing options...
partha99 Posted December 12, 2007 Author Share Posted December 12, 2007 Dear Betty, Thanks for your good suggestion. Checked with directly inputting unicode values in text field in iReport.They display properly in pdf output also. when retrieved from the database certain combination character like unicode values like u0b90,u0bb0. combination of consonant and vowels.are not displayed properly in pdf output only whereas jrviewer and html gives proper output. Iam using postgres 7.4 with UTF-8 encoding.storing the data using ISO--8859-1 encodingretrieving the data using UTF-8 encoding if i store and retrieve using UTF-8 it stores only junk and displays junk. expecting further suggestions please. K.Parthasarathy Link to comment Share on other sites More sharing options...
itchytoes Posted December 13, 2007 Share Posted December 13, 2007 Hi -- I'm afraid now your problem is outside of my knowledge base. I've only used the unicode characters for their symbols, so my reports have just contained the strings with the hex representation of the characters. I've never tried display data from a database that has special characters. Also, I've never used postgresSQL-- we use oracle and mysql here. Otherwise, I'd play with with a simple example. My first suggestion is to make sure that your tamil characters made it into your DB correctly. One simple thing you can do is run a simple JDBC program to read the data back into java String and just dump out the unicode characters of the String to be sure that Java reads the data correctly and you get the unicode that you expect. Then, you can deal with jasper issues after that. Betty Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 13, 2007 Share Posted December 13, 2007 Hi, Looking at the report sample you posted, I can tell that you are not using isPdfEmbedded="true". I think you should, otherwise you are counting on the tamil font to be installed on the system where you view the PDF. This is probably not the case, hence the problem.Also, make sure you use the pdfFontName attribute also in the styles, your default style there does not use it. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
partha99 Posted December 13, 2007 Author Share Posted December 13, 2007 I have checked with ispdfEmbedded=true option also. In tamil the typing sequence is different from the display format.In display consonants and vowels combine and display as a single letter whereas they are 2 different keystrokes. The database displays in proper format when queried using query tool.When the value is extracted using a jsp program it gives unicode literal values they are as per typing sequence. This is properly hanlded by browsers like firefox with pango support and Konqueror.when i type in Openoffice writer and convert to pdf it does properly.I feel the support is not there is itext which ireport used for pdf conversion for handling indian languages.Is there any other utility like itext which can generate pdf from ireport with proper displayor is there any plugin for itext to handle this. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 13, 2007 Share Posted December 13, 2007 Hi, You mean it is about text run direction: right-to-left and left-to-right mixed writing?I think iText is pretty good when it comes with text direction, as far as I know.It would be helpful if you could post some relevant files here, like JRXML with hardcoded text fields and resulting PDF, as well as a screenshot of the correct output. Thank you,Teodor Link to comment Share on other sites More sharing options...
lucianc Posted December 13, 2007 Share Posted December 13, 2007 partha99 wrote:I feel the support is not there is itext which ireport used for pdf conversion for handling indian languages.Is there any other utility like itext which can generate pdf from ireport with proper displayor is there any plugin for itext to handle this. I found an apparently related psot on the iText forum. Quoting from the post:the words in some languages, like Hindi are spelled wrong.This is because iText shows you the characters as they appear in the XML.iText doesn't do ligaturizing for Indic languages, only for Arabic.(If somebody feels like writing an IndicLigaturizer, I'd be happy to add it to iText.) The post is from two years ago but I couldn't find any indication that this has been fixed in the mean time. If this is the problem you are describing, then I don't think there's anything you can do to make it work in iReport. The only way of producing PDF output with JasperReports is by using the iText-based PDF exporter. Regards,Lucian Link to comment Share on other sites More sharing options...
partha99 Posted December 13, 2007 Author Share Posted December 13, 2007 Hi,Iam attaching the jrxml and screenshots in html and pdf generated with iReport.Iam able to generate pdf from openoffice writer properly.Since both are opensource community can the solution be obtained for itext from openoffice. Partha [file name=unicodepdftest.zip size=36087]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/unicodepdftest.zip[/file] Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 13, 2007 Share Posted December 13, 2007 Hi, If two products are both open source, it does not mean they work the same. They are two different products, developed by different people, using totally different technologies. The fact that it works for you in OpenOffice, is completely irrelevant to why it does not work in iText. In any case, this is not something we can help with at this point. You should consider posting this on the iText discussion forums and mailing lists. Thanks,Teodor Link to comment Share on other sites More sharing options...
partha99 Posted December 14, 2007 Author Share Posted December 14, 2007 Thanks to you all. I will post the issue to itext forum as suggested. Partha Link to comment Share on other sites More sharing options...
prashanth.talkad Posted October 14, 2008 Share Posted October 14, 2008 I have a similar issue with Maori Macrons - I am running a report with the code below for a field that needs to display Maori Macrons. It displays fine within JRViewer, and its fine when I export it to word or excel, but craps out when I export to PDF. I've pasted my code below for that field. Any suggestions welcome. x="9" y="25" width="523" height="12" key="textField-7"/> $F{V_PERSON_ADDRESSING_NAME} Also, iReport documentation conatains a sentence that says that they have a rich set of encoding types, but which one is best to use for Unicode? I see a Identity-H and -V which does not solve the problem. Also, all fields in my report are consistent in terms of the PDF encoding and PDF font and PDF embedded values. Link to comment Share on other sites More sharing options...
shrije Posted October 14, 2008 Share Posted October 14, 2008 The problem is with the PDF font u have selected. Please select a font having a unicode characters. For example Arial_UnicodeMS. You want find this in the normal list of PDF fonts. But you can set the "windows fonts" path in the classpath of iReport. After doing this you will get this font name. Try one of the Identity-H or Identity-V. it will work wonders. Please see the attachement. In your case the Tamil fonts need to be in Unicode. Only then can u see the fonts correctly in pdf. But i feel Tamil by default will be unicode. Link to comment Share on other sites More sharing options...
shrije Posted October 14, 2008 Share Posted October 14, 2008 I have tried your font and it works fine with me. Make sure you have set the UTF-8 in report properties. Link to comment Share on other sites More sharing options...
shrije Posted October 14, 2008 Share Posted October 14, 2008 Even the one you sent works. See the attachement Link to comment Share on other sites More sharing options...
raja38 Posted December 31, 2008 Share Posted December 31, 2008 Hi the same pbm coming for me too. I have filled all that info which was mentioned on this previous posts . But still that tamil font on PDF is not coimng properly .Pls give the correct info about this. ByRaja ManiJunior Research FellowIndiateodordWrote: Hi, Looking at the report sample you posted, I can tell that you are not using isPdfEmbedded="true". I think you should, otherwise you are counting on the tamil font to be installed on the system where you view the PDF. This is probably not the case, hence the problem. Also, make sure you use the pdfFontName attribute also in the styles, your default style there does not use it. I hope this helps. Teodor Link to comment Share on other sites More sharing options...
shrije Posted January 1, 2009 Share Posted January 1, 2009 Please check if your XML encoding is UTF-8. Link to comment Share on other sites More sharing options...
rkvsraman Posted May 6, 2009 Share Posted May 6, 2009 Hi, We are happy to release a version of Jasper Reports enabled for Complex Scripts Support in PDF export. This include languages under Indic Scripts like Hindi, Tamil, Bengali, Gujarati, Kannada and others. It also includes support for scripts like Sinhalese and Thai. It is based using OpenOffice as a PDF generating agent and API and does not use iText. Please download it from http://202.141.136.157/bharateeyaoo/jasper.shtml Have a great day. Best Regards -RKVS Raman Link to comment Share on other sites More sharing options...
rkvsraman Posted May 6, 2009 Share Posted May 6, 2009 Hi,We are happy to release a version of Jasper Reports enabled forComplex Scripts Support in PDF export. This include languages underIndic Scripts like Hindi, Tamil, Bengali, Gujarati, Kannada andothers. It also includes support for scripts like Sinhalese and Thai.It is developed using OpenOffice as a PDF generating agent and API anddoes not use iText.Please download it from http://202.141.136.157/bharateeyaoo/jasper.shtmlHave a great day.Best Regards-RKVS Raman Link to comment Share on other sites More sharing options...
anyone Posted July 22, 2010 Share Posted July 22, 2010 <font fontName="Mangal" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="C:\Windows\Fonts\Mangal.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/> just give the path of ttf in font tag. and must ser isPdfEmbede=true.Thanx. 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