part_od Posted August 14, 2006 Share Posted August 14, 2006 Hi everybody. I have a trouble with pdf when i putting textfield with "PDF Encoding CP1251 (Cyrillic) ". Letters are imposed like this [file name=ReportEnergy.pdf size=2726]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ReportEnergy.pdf[/file]Post edited by: part_od, at: 2006/08/14 11:57 Link to comment Share on other sites More sharing options...
sww Posted January 10, 2008 Share Posted January 10, 2008 That should work fine, if you have a font selected that correctly displays cyrillic. I'm trying to do the same, and I found that using Tahoma as the font (also pdfFontName - I actually set it to Code:c:\windows\fonts\tahoma.ttf - do use double \!!! ) - and setting pdfEmbedded 'true', then it works, kind of. It works for static textFields - I have not yet figured out how to get data textFields to display cyrillic. So far none of the advice I've fo und here has worked. :(Post edited by: sww, at: 2008/01/10 12:25 Link to comment Share on other sites More sharing options...
Pedja Posted January 10, 2008 Share Posted January 10, 2008 Thanks for the Tahoma tip, it does work. I have the same problem, and there is at least dozen threads on this forum abuut this problem, and not one good answer. It would be nice if someone from the development team gave us the solution. However, I've tested my reports with Foxit and it displays Cyrillic as it should, with all fonts, but Adobe Reader is the problem. Link to comment Share on other sites More sharing options...
sww Posted January 10, 2008 Share Posted January 10, 2008 I have just downloaded Foxit but the DATA textfields - i.e. the ones populated from the page data source with cyrillic characters - are still all blank. I have used the debugger to trace the code where the data is read from the data model, and I can see the cyrillic characters in the data at that point. The data is all held in Java Strings, so I can't understand why it isn't displaying them properly. I wish someone would either tell us straight how it's done OR simply admit it can't be done, if that is the case. Link to comment Share on other sites More sharing options...
Pedja Posted January 10, 2008 Share Posted January 10, 2008 I didn't try with data fields, my cyrillic reports were all numeric, only statistic data were returned from the database so I didn't notice, sorry. Can anyone give us a working solution for this problem? Link to comment Share on other sites More sharing options...
sww Posted January 10, 2008 Share Posted January 10, 2008 I have just tried something different, and now got a textfield populated from the data model that IS displaying (one) cyrillic character - I just changed one character in a string in the DB and it's showing in the PDF... The other fields that are NOT displaying are a) in a crosstab and b) in a subreport... Once I've figured out what's going on I'll report back. Link to comment Share on other sites More sharing options...
sww Posted January 11, 2008 Share Posted January 11, 2008 Well, I've got it working :) It is a complex inter-play between iReports and the configuration needed by iText (within JasperReports.) Simple fix: For 'fontName' select a fontname that maps to one of the built-in PDF fonts - e.g. Times New Roman, and for the pdfFont set it to "c:/windows/fonts/tahoma.ttf" - and you *should* see the cyrillic characters as required. I am currently looking further for a more complete solution, but the above should get things moving forward. Link to comment Share on other sites More sharing options...
Pedja Posted January 14, 2008 Share Posted January 14, 2008 Great! I don't have much time right now to experiment with cyrillic encoding, but I will get to it as soon as I can! One other thing, I tried reading cyrillic values from the database, and Foxit displays them as it should with default settings (Font Name = SansSerif, PDF Font Name = Helvetica). I am using iText-2.0.7.jar. Link to comment Share on other sites More sharing options...
sww Posted January 14, 2008 Share Posted January 14, 2008 Yes, I am also getting different results with static text vs. data fields. It is all very confusing... 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