hand79 / Hadoop

Hadoop 開發實作&筆記
0 stars 0 forks source link

Arabic text in pdf exports from tables in JMesa #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In our application we need to support arabic text.

When we invoke the "export as pdf" function in a jmesa table that contains
arabic text, we were expecting to see the arabic text in the PDF but
instead we are getting just blanks where it is expected.

We did a little debugging and realized that the HTML that xhtmlrederer does
for that table seems ok, as it includes HTML entities with the correct
unicode character codes for the arabic text presented on the web page.

We've also inspected the generated PDF and seems to include only the font
"WinAnsiEncoding" wich will be unable to represent the arabian text.

We are using JMesa inside a J2EE application in a JBoss in a Linux machine
using JDK 1.5

Original issue reported on code.google.com by arga...@gmail.com on 7 May 2010 at 10:27

GoogleCodeExporter commented 9 years ago
Did you get anywhere on this? I think there is a way that you can specify the 
font
that you use for the pdf in one of those pdf libraries. You can modify the 
JMesa pdf
view and export (the streaming out to the response) real easy so let me know if 
you
need help from that perspective.

Sorry for the slow response...this issue slipped my mind.

Original comment by jeff.johnston.mn@gmail.com on 12 May 2010 at 2:25

GoogleCodeExporter commented 9 years ago
Thanks for your kind comments on this issue.

I'm afraid that embedding some font capable of rendering arabian text is not 
enough 
to solve the issue. iText also needs to specify the direction of the text 
embodied in 
an paragraph( right to left ) whenever it writes arabian text.

If we were exporting arabian only tables in PDF seems that it wouldn't be a 
problem 
to modify jmesa to suit our needs, but we are in need of rendering pdf from 
tables 
that mix occidental and oriental languages ( and characters ). Do you think 
jmesa 
would be flexible enough to let the pdf rendering module to be aware when 
receiving 
arabian text (or characters in some other right to left written languages?

Original comment by arga...@gmail.com on 12 May 2010 at 7:33

GoogleCodeExporter commented 9 years ago
It would be. The reason I say that is JMesa's exports are very easy to modify. 
You
can read the "How can I plug in my own export view?" in the recipes for more 
information.

http://code.google.com/p/jmesa/wiki/ExportRecipes?ts=1273670194&updated=ExportRe
cipes

Then here are some links to show you what the current exports look like. If you 
need
to modify something I would start with these and tweak them how you need to. 
Remember
too that the pdf view uses the flying saucer api and the pdfp view uses the 
iText api
directly.

http://code.google.com/p/jmesa/source/browse/#svn/trunk/jmesa/src/org/jmesa/view
/pdf
http://code.google.com/p/jmesa/source/browse/#svn/trunk/jmesa/src/org/jmesa/view
/pdfp

Original comment by jeff.johnston.mn@gmail.com on 12 May 2010 at 1:21

GoogleCodeExporter commented 9 years ago
Not sure where we left off with this...closing for now.

Original comment by jeff.johnston.mn@gmail.com on 10 Mar 2011 at 9:26