I am unable to see Hindi characters in my BIRT generated pdf files. The way I am trying to accomplish this is as follows:
- I created a rptdesign file. You can download it from here. The file contains just 2 labels - name and class.
- Associated the rptdesign file with a translation file by adding the translation file as a resource. The name of the translation file is translation_hi_IN.properties. The translation file can be downloaded from here. I have used the localization feature and associated the 'Name' label to a Hindi word using this translation file.
I have added the following lines in code so that when I run my web application on Tomcat it is able to access the rptdesign file and the translation file.
EngineConfig config = new EngineConfig(); config.setResourcePath("D:/rptDesignFiles");
I have created the fontsConfg_pdf.xml so as to load the Mangal font for Hindi script. It can be downloaded from here. This fontsConfg_pdf.xml file i have placed in the same folder as the rptDesign file. And in code I have added the following lines
URL fontConfig = null; try { fontConfig = new URL("file:///D:/rptDesignFiles/fontsConfig_pdf.xml"); config.setFontConfig(fontConfig); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); }
When I generate the report I can see in logs that first it loads the fontsConfig.xml present in org.eclipse.birt.runtime-4.2.1a.jar and then it loads my custom fonsConfig_pdf.xml
But all I see is blank for my 'Name' label in the generted pdf.
I have looked through a lot of forums but unable to figure out the mistake. Could someone please guide me as to where I am going wrong. Thanks a lot !