allcolor / YaHP-Converter

YaHP is a Java library that allows you to convert an HTML document into a PDF document.
GNU Lesser General Public License v2.1
56 stars 23 forks source link

Issues in RTL(Right to Left) Languages content in generated PDF #31

Open dhinesherode91 opened 9 years ago

dhinesherode91 commented 9 years ago

Hi,

I am generating a PDF through HTML using YAHP Converter. I am facing issue in one scenario. If my html content contains any RTL(Right to Left) languages such as Arabic, Hebrew.., in browser it is getting displayed as from Right to left direction as expected. But in the PDF that is generated via YAHP it is not displayed as RTL and displayed only as from Left to Right direction.

On Exploring I could find that the browser will recognize the RTL languages and will display them in the respective direction implicitly. We can also set the direction of the text using "dir" attribute explicitly for any tags(span,div..etc), so that the respective direction can be notified explicitly. This is working fine in browsers. But when i pass the same HTML content to YAHP, it is not working fine and always displays the text from left to Right mode.

Please suggest me with your ideas or solutions to work out this.

Thanks in advance.

allcolor commented 9 years ago

Hi, if you use the css 'direction: rtl' property, is it working?

Regards Le 11 févr. 2015 06:27, "dhinesherode91" notifications@github.com a écrit :

Hi,

I am generating a PDF through HTML using YAHP Converter. I am facing issue in one scenario. If my html content contains any RTL(Right to Left) languages such as Arabic, Hebrew.., in browser it is getting displayed as from Right to left direction as expected. But in the PDF that is generated via YAHP it is not displayed as RTL and displayed only as from Left to Right direction.

On Exploring I could find that the browser will recognize the RTL languages and will display them in the respective direction implicitly. We can also set the direction of the text using "dir" attribute explicitly for any tags(span,div..etc), so that the respective direction can be notified explicitly. This is working fine in browsers. But when i pass the same HTML content to YAHP, it is not working fine and always displays the text from left to Right mode.

Please suggest me with your ideas or solutions to work out this.

Thanks in advance.

— Reply to this email directly or view it on GitHub https://github.com/allcolor/YaHP-Converter/issues/31.

dhinesherode91 commented 9 years ago

I have tried that one and it is not working. Also I have tried using 'bdo' tag and still I can't make that working.

Thanks.

allcolor commented 9 years ago

Then unfortunately I can't help you. I do not maintain the project anymore since three years now, so I don't plan to do any bugfix anytime soon. What you should try is to use font embedding and the css style inline on the tag itself.

Regards. Le 11 févr. 2015 09:16, "dhinesherode91" notifications@github.com a écrit :

I have tried that one and it is not working. Also I have tried using tag and still I can't make that working.

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/allcolor/YaHP-Converter/issues/31#issuecomment-73852146 .

dhinesherode91 commented 9 years ago

Thanks for your suggestion..

I have tried that by embedding the font type as 'Arial Unicode family' and by setting the inline css direction style as 'rtl' in the tag level and still there is no luck.

I am exploring on any other possibilities to achieve it.

Thanks.