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

查看:77
本文介绍了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>

如果您使用双向比替代和方向,则效果很好.我在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.

顶部图像是Antennahouse,中间的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.

这是此示例的完整示例:

Here is the complete example for this one:

    <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天全站免登陆