我已经在linux的本地环境中安装了王子xml。
连字符属性适用于泰米尔语的本地环境,当我将以下 css 代码添加到样式的王子源文件夹中的文件 hyph.css 中时。
:lang(ta) {
hyphens:auto;
prince-hyphenate-patterns: url("../hyph/hyph-ta.pat");
}
并将所需的文件 hyph-ta.pat 复制到 Prince 源文件夹中的 hyph 文件夹。
现在连字符在 Prince xml 在本地环境中生成的 html 内容的 pdf 中起作用。
给王子 xml 的内容可以通过远程 url 给出,以便在本地生成。
对于像 DocRaptor 这样的 Prince xml 的 API,我们无法访问 Prince 源文件来复制/编辑文件 hyph-ta.pat 和 hyph.css。
对于 DocRaptor API,我将提供内容以通过 HTML 内容而不是远程 url 生成 pdf。
因此,我在 html 内容的 style 属性中编写了上面的 css 代码,该属性将提供给 DocRaptor API。而如果我们将html内容中prince-hyphenate-patterns的属性值改为http资源url指向hyph-ta.pat文件
:lang(ta) { hyphens:auto; prince-hyphenate-patterns: url("http://../hyph-ta.pat"); }
连字符在生成的 pdf 中不起作用。
在 Docraptor API 中使用连字符是否需要任何其他要求?
每当我在 http 资源文件中给出属性“prince-hyphenate-patterns”时,连字符在本地环境和 DocRaptor API 中生成的 pdf 文档中都不起作用。