Mange Posted April 16, 2015 Share Posted April 16, 2015 Hi all,This is my environment:Windows 7IDE = NetBeans 8.0.2Create the reports with Jaspersoft Studio 5.5.1All fields and parameters are setup with font = SansSerifDifferent languages are supported with property files.For Chinese I use "Text_zh_CN.properties". I also have translation for Spanish and PortugueseChinese translation use Unicode. Example: “Equipment=u8bbeu5907”This display properly exporting to docx-file but not to pdf.I can’t find a way to get SansSerif to be included in the PDF Font Name. I tried the following alternatives:With a tip from another question I tried and downloaded “Arial Unicode.jar” and added to the “Java Build Path”. But I can’t find the Arial as an option for the PDF Exporter or as an option for PDF Font Name for the TextField.Changed the setting for a field (I test with one field to see if I can get it to work) and set it up as:PDF Embedded=truePDF Encoding= (Tested all that show Chinese)PDF Font Name=MHei-MediumI get the following error when I run the report as a PDF:Error - JasperViewer ListOfEquipment e:Could not load the following font :pdfFontName : MHei-MediumpdfEncoding : UniGB-UCS2-HisPdfEmbedded : trueI can’t figure out what is missing and where to get this to work. Link to comment Share on other sites More sharing options...
marianol Posted April 17, 2015 Share Posted April 17, 2015 Is the font available in the JVM that the report is running? To build font extensions go to the JasperSoft Studio preferences page "Jaspersoft Studio-> Fonts". Here you can also use the export wizard to export a font extensions: this produce a jar with all the necessary information for JR. there is a nice tutorial here: http://community.jaspersoft.com/wiki/custom-font-font-extensionTwo other things:- when creating/modifying the font familiy, in the section "PDF details", use the flag "Embed this font in PDF document"- when deploying your report, you must export your custom font families, so it is useful to export them as jar using the "Export" button available in the related Preferences page (Jaspersoft Studio > Fonts).Here are some pointers http://jasperreports.sourceforge.net/sample.reference/fonts/index.html Link to comment Share on other sites More sharing options...
Mange Posted April 21, 2015 Author Share Posted April 21, 2015 Thanks Marianol.I followed the links and since I added "Arial Unicode.jar" to the project I can select that font for my text field.I added the jar-file to the libraries in my project and "C:Program FilesNetBeans 8.0.1javamoduleslocale".I set the PDF Embedded = truePDF Encoding = <INHERETED>PDF Font Name = <INHERETED>Word is working but the PDF exporter show the following Error - JasperViewer ListOfEquipment e:com.lowagie.text.DocumentException: Font '' with 'Cp1252' is not recognized.What to do so I can select Arial Unicode for the PDF Font Name? 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