FOP apache - 支持希伯来字母 [英] FOP apache - support Hebrew letters

查看:32
本文介绍了FOP apache - 支持希伯来字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近几天我一直在调查 FOP apache 中对希伯来字母的支持生成PDF文件的项目.

I've been investigating in the last few days the support of Hebrew letters in the FOP apache project for generating PDF file.

我之前看到那个有问题,我真的不明白它是否已经解决了?

I saw that there was a problem with that in the past and I didn't really understood whether it been solved or not?

如果有支持,有人可以向我展示/重定向给我带有希伯来字母的 XSL-FO 文件的简单示例,当使用 FOP 时,PDF 会正确生成(清晰且不会被订单字母颠倒).

If there is a support, can somebody show/redirect me to simple sample giving me XSL-FO file with Hebrew letters that when using FOP the PDF is generated properly(clear and not reversed by order letters).

非常感谢您的回答.这件事真的很困扰我,我想因为这个而转向 IText...

I would really appreciate your answer. This thing is really bothering me and I thinking moving to IText because of this...

推荐答案

您在寻找什么样的样本?对我来说很好用......

What kind of sample are you looking for? Works fine for me ...

 <fo:list-item><fo:list-item-label end-indent="label-end()"><fo:block>Hebrew</fo:block></fo:list-     item-label>
 <fo:list-item-body start-indent="body-start()"><fo:block xml:lang="he"><fo:bidi-override    
 unicode-bidi="embed" direction="rtl">כאשר העולם רוצה לדבר, הוא מדבר ב־Unicode</fo:bidi-
 override></fo:block></fo:list-item-body></fo:list-item>

如果您使用 bidi-override 和 direction 它工作正常.我在 RenderX、Antennahouse 和 Apache FOP 中对此进行了测试,结果相同.

If you use bidi-override and direction it works fine. I tested this in RenderX, Antennahouse and Apache FOP and the results are the same.

上图是天线房,中间 RenderX 和底部 Apache FOP.

Top image is Antennahouse, middle RenderX and bottom Apache FOP.

根据您下面的问题,使用方向 rtl 和 bidi-override 是因为句子包含混合的英语和希伯来语.如果你只有希伯来语,它应该格式正确.使用 FOP 以三种方式查看此图像.中间版本不正确,因为它需要这些属性.

Per you're question below, the use of direction rtl and bidi-override is because the sentence contains mixed English and Hebrew. If you only had Hebrew, it should format correctly. See this image with FOP all three ways. The middle version is not correct because it requires these attributes.

这是这个的完整示例:

    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
    <fo:simple-page-master master-name="PageMaster" margin="25mm" page-width="8.5in" page-height="11in" >
    <fo:region-body margin="10mm"/>
    <fo:region-before extent="6mm" display-align="center"/>
    <fo:region-after extent="6mm" display-align="center"/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="PageMaster">
    <fo:flow flow-name="xsl-region-body" line-height="1.7" font-family="Arial Unicode MS">
    <fo:block>Mixed English and Hebrew with Override</fo:block>
    <fo:block xml:lang="he"><fo:bidi-override unicode-bidi="embed" direction="rtl">כאשר העולם רוצה לדבר, הוא מדבר ב־Unicode</fo:bidi-override></fo:block>
    <fo:block>Mixed English and Hebrew no Override</fo:block>
    <fo:block>כאשר העולם רוצה לדבר, הוא מדבר ב־Unicode</fo:block>
    <fo:block>Hebrew only no Override</fo:block>
    <fo:block>כאשר העולם רוצה לדבר, הוא מדבר ב־</fo:block>    
    </fo:flow>
    </fo:page-sequence>
    </fo:root>

这篇关于FOP apache - 支持希伯来字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆