Jump to content
We've recently updated our Privacy Statement, available here ×

Right to Left languages Persian Hebrew


vahid

Recommended Posts

Hi,

I've a report in Persian language (Persian is Right to Left language). My application is web based. Besides some text in Persian I have a chart in the report. The chart is created by using JFreeChart.  The text and the chart are passed to the report as parameters. Later the report is exported to PDF.

All the texts in the in the report are correct and readable (All the texts are in Persian). The problem is the text in the chart. Chart's legend and bar labels are rendered in Persian but all the text in chart and ONLY chart are the other way around e.g. (table is elbat -  In the example I've used English just to clarify the issue. Actual problem is in Persian.) I changed the chart text to English and everything was quite ok. The problem is RIGHT TO LEFT languages.

I've done some digging in the forum and came upon a thread pinpointing same issue in Hebrew language which is also Right to Left but I could not conclude a solution out of it.

Further information:

I'm wrapping JFreeChart in JCommonDrawableRendere before passing it to the exporter.

And

Using JRRenderable class in <imageExpression> to show the chart.

Please, if anyone could help me

Regards

 

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

This seems to be a limitation of iText's PDFGraphics2D, which doesn't support RTL or Bidi texts.

One workaournd is to render the chart to a BufferedImage, and use a plain image renderer to display the chart.  The problem with this is that the chart will be displayed as a rasterized image, and not rendered as a SVG.  A solution to this is to go through a Batik SVG, as net.sf.jasperreports.charts.util.SvgChartRendererFactory does.

Regards,

Lucian

 

Link to comment
Share on other sites

  • 4 years later...
  • 3 years later...
  • 5 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...