我在我的工作场所创建了一个小型Java应用程序来生成XML文件的PDF。我需要启用连字符,因为在单元格边界之外的表中有一些文本。
我下载了OFFO编译的FOP连字符模式,并将fop-hyph.jar文件与我的fop.jar放在我的"lib“文件夹中。
当我运行应用程序时,我会得到以下错误:
Jan 20, 2016 2:57:43 PM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
SEVERE: Couldn't find hyphenation pattern for lang="en",country="US".我使用的是FOP2.0,在我的fop.xconf文件中有以下条目:
<hyphenation-pattern lang="en">en_US</hyphenation-pattern>我也尝试过这一点,但没有区别:
<hyphenation-pattern lang="en" country="US">en_US</hyphenation-pattern>在XSL文件的根目录上,我输入了:
<fo:root font-family="Helvetica" language="en" country="US" hyphenate="true">我错过了什么才能让它发挥作用?其他一切都很好,可以正确地创建PDF。
发布于 2016-01-22 10:37:54
根据连字符模式安装指令,美式英语的模式文件称为“en.xml”,因此在配置文件中您应该拥有:
<hyphenation-pattern lang="en">en</hyphenation-pattern>顺便说一句,配置文件中的条目只有在您想要与默认行为不同的东西时才需要,因此在本例中,可以完全省略它。
https://stackoverflow.com/questions/34910810
复制相似问题