how to display arabic fonts in jasper report? [duplicate] - jasper-reports

This question already has answers here:
How to show arabic,Hebrew,etc language fonts on jasper (iReport) reports
(3 answers)
Jasper Reports PDF doesn't export cyrillic values
(1 answer)
Closed 10 months ago.
I am using Jasper Studio to design my report and link it with Spring Boot Application to fill the data.
I added Arial Jar file to the project and it works very well on the embedded server inside Spring Tool Suite.
But, when I run the report, it does not work well with Arabic.

Related

Arabic characters do not display correctly [duplicate]

This question already has answers here:
RTL not working in pdf generation with itext 5.5 for Arabic text
(3 answers)
Closed 4 years ago.
For my website, I use itextpdf 5.5.4 to generate PDF downloads. The website is meant for people who speak English. Recently, a user from Egypt used the site, entered some Arabic content, and contacted me with the problem he has.
This is his Arabic content shown correctly in the browser:
This is incorrect display in PDF:
Here is the Java code I have. Please note that it is actually able to generate PDF with Chinese characters CORRECTLY:
BASE_FONT base = BaseFont.createFont("/fonts/ARIALUNI.ttf", BaseFont.IDENTITY_H , BaseFont.EMBEDDED);
Font f = new Font(base, 10f);
String htmlString = string_with_Arabic_text;
Paragraph p = new Paragraph(htmlString, f);
p.setSpacingBefore(20.0f);
p.setSpacingAfter(7.0f);
document.add(p);
How to fix the problem?
In Eclipse (the IDE I use), I am able to see Arabic characters display correctly in htmlString. At this moment, I cannot upgrade to use the latest version of itextpdf due to various project reasons.
iText 5 has limited support for non-Western writing systems. It support right-to-left writing but only in the context of ColumnText and PdfPCell objects.
This is an iText 5 example with ColumnText where p contains text in Arabic:
ColumnText canvas = new ColumnText(writer.getDirectContent());
canvas.setSimpleColumn(36, 750, 559, 780);
canvas.setRunDirection(PdfWriter.RUN_DIRECTION_LTR);
canvas.addElement(p);
canvas.go();
This is an iText 5 example with PdfPCell where p contains text in Arabic:
PdfPCell cell = new PdfPCell(p);
cell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
This is very annoying, as it would mean that you have to rewrite your entire application so that all text is added either in a ColumnText or in a PdfPCell object. You'd also have to examine the content to check if you need to change the run direction.
As you have to rewrite the application anyway, it would be best to upgrade to iText 7, because iText 7 has an add-on that detects the writing system based on the UNICODE values of the content (see pdfCalligraph). When Arabic or Hebrew text is detected, the add-on changes the writing system for "left to right" to "right to left." See How to display Arabic strings from RTL in PDF generated using itext 7 API?
I see that you are coding your document. Please note that you can save yourself a lot of work by creating the content in HTML, and then converting it to PDF using the pdfHTML add-on. The PDF to HTML tutorial has some examples involving Arabic. See the section on internationalization in chapter 6, and the following FAQ entries:
Which languages are supported in pdfHTML?
How to convert HTML containing Arabic/Hebrew characters to PDF?
iText 7 is also the first version that supports more writing systems, such as Devanagari, Tamil, Telugu,... For more info, read the pdfCalligraph white paper.
Important: the pdfCalligraph add-on is closed source. You'll need a trial license to test it and a commercial license to use it in production. Note that the current version of iText that you are using is licensed as AGPL software, which implies that you can't use your project in a closed source context. You mention external users, which means that you are distributing your service. Did you open source all your own source code? If not, you should purchase a commercial license for your use of iText.

Reports with multiple orientations and continuation templates

I am currently working on a project that has chosen JasperReports as their tool to create PDF documents. It is a PHP project, using web services to talk to JasperReports to create the PDF's from pre-designed templates.
Unfortunately, everyone on the project has very little experience with JasperReports and Jaspersoft Studio.
One of our requirements is to build a report, where the first page is landscape and has many text fields on them, 2 of which (if the text overflows) need to continue onto 2 different reports (both portrait).
We are having trouble finding a solution to allow multiple orientations, and continuing the 2 different text areas on 2 different continuation sheets.
Any help or suggestions would be appreciated.

Crystal Report of Exported PDF version

Currently I am using Crystal report 11 to generate reports in PDF format.
The version in which PDF's are generated in 1.3
I would like to upgrade the PDF version to 1.4 (For ISO Document).
Could anyone please advise me what is the way forward on this?
Based on the answers below, it looks like you will need to upgrade the version of Crystal Reports you are using or use some other program to convert the PDF. It appears that Crystal Report does not have a setting for PDF Version.
Creating version 1.5 PDFs instead of version 1.7 PDFs from CR2010
http://scn.sap.com/thread/2093502
Exporting RPT to PDF version 1.3 in Crystal Reports 10.5.3700
http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_25349902.html
Other solutions:
http://www.nicepdf.com/products.html
http://en.softonic.com/s/pdf-version-converter-2.01

what are different preview report using excel preview and excel preview(using J ExcelApi) in iReports 2.0.2?

i'm still new in Jasper reports.i still confuse what the different preview report using excel preview and excel preview(using J ExcelApi) in iReports 2.0.2.Which is more common that people use?. is there any effect when we generate the report?. Can anybody tell me?
Jasperreports supports multiple export formats (xls, pdf, csv, etc...). After developing a report using iReport, you can generate a report in any of those export formats. The best way to view those reports is using an external appliction that you can map. For example, xls report is tied with Excel and pdf reports are tied with Adobe Reader. The new version of iReport supports generation of these reports using the application itself (preview). However, what happens in the background is the same whether you view it with external viewer or internaly using iReport "preview". Personaly, I prefer to use external viewer. The exported reports are cached in the compilation directory.

Converting to unicode font in Crystal Reports

I want to convert Report Headers and Section Headers to Hindi unicode font. At present I am using a Hindi font which is not rendering properly on various browsers. Is there any way to convert the Report Header and other fonts to unicode in Crystal Reports 2005?
If by Crystal Reports 2005 you mean the version of CR that bundles with .NET 2005, then you want to look at the following;
Working with Default and Custom Language Resource Files
Compiling the Custom Resource Files
Web: Configuring Global or Local Custom Resources
You also want make sure you are using SP 1 for CR 10.2:
https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
Note that new, stand alone version(s) of CR have better localization support. Looking at CR 2008 (12.x) may be something to consider. An Eval of CR 2008 is available here:
http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
Hope this will help !