Posts filed under 'java'
Exporting PDF using JasperReport in Arabic
Exporting PDF using JasperReport in Arabic
When you try to export PDF file using JasperReport in arabic characters, the characters may not be appeared specially in PDF format.
The key answer of this issue is quite pretty and sample.
In Desktop applications:
1 – Download Arial.ttf font .
2 – Put the Arial.ttf font in your application class path.
3 – From JasperReport designer:- Put your cursor on the properties of the detail in which it will display Arabic characters and select Arial.ttf font from PDF Font name and check isPdf Embedded checkbox and select Arial as a fontName and select “Identity-H as pdfEncoding.
Or you may also replace the font tag in your jrxml at the xml tab source with the following tag :
<font fontName=”Arial” pdfFontName=”ARIAL.TTF” size=”22″ isPdfEmbedded =”true” pdfEncoding =”Identity-H”/>
Note: you can change your font size as much as you need.
In web applications :
Attempt almost the same desktop instructions but put your Arial.ttf font in the folder WEB-INF/classes and of course it will be relative to your application.
I hope it will be useful for you all
.
Good Luck & Best Regards.
4 comments 23 December 2008
NetBeans IDE 5.5.1 Swing Layout Extension
Peace be upon you all.
When you try to import your code you used in netbeans IDE 5.5.1 to your Eclipse, you will encounter the following issue :-
Multiple markers at this line
- org.jdesktop cannot be resolved to a type
- org.jdesktop cannot be resolved to a type
NetBeans IDE 5.5.1 uses swing layout extension to build its GUI applications, the code is auto generated, you don’t have the ability to change the auto generated code since the content of the generated method is always regenerated by the form editor.
This is the comment of the auto generated method:
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
In order to import your netbeans code into other IDEs like Eclipse, you must have the swing layout extension. Perform the following steps to let your code runs on eclipse.
1 – Go to the netbeans 5.5.1 IDE in the main project you are in it.
2 – open the Libraries node.
3 – Locate the swing-layout-1.0.jar at the Libraries node. It should be in the netbeans installation folder “platform6\modules\ext”
4 – Copy the swing-layout-1.0.jar to your Eclipse project and add it to your build path.
5 – Run the Eclipse project, it will run normally as you run it from your netbeans IDE 5.5.1.
Regards,
2 comments 6 May 2008