简体   繁体   English

对于在DocRaptor API中不起作用的外部语言,Prince XML的连字符号

[英]Hyphenation of Prince XML for external languages not working in DocRaptor API

I have installed prince xml in local environment in linux. 我在linux的本地环境中安装了prince xml。

The hyphenation property works in local environment for tamil language, when i add the below css code in the file hyph.css in prince source folder of style. 当我在样式的prince源文件夹中的hyph.css文件中添加以下css代码时,连字属性在泰米尔语言的本地环境中工作。

:lang(ta) { 
    hyphens:auto;
    prince-hyphenate-patterns: url("../hyph/hyph-ta.pat"); 
}

and by copying the required file hyph-ta.pat to hyph folder in prince source folders. 并将所需文件hyph-ta.pat复制到prince源文件夹中的hyph文件夹。

  • Now the hyphenation works in generated pdf of html content in local environment by prince xml. 现在连字符在prince xml在本地环境中生成的html内容pdf中起作用。

  • The content given to prince xml can be given by a remote url for generating in local. 提供给prince xml的内容可以通过远程URL给出,以便在本地生成。

  • In case of API of prince xml like DocRaptor, we didn't have access to prince source file to copy/edit the files hyph-ta.pat and hyph.css. 对于像DocRaptor这样的prince xml的API,我们无法访问prince源文件来复制/编辑文件hyph-ta.pat和hyph.css。

  • For DocRaptor API i will give content to generate the pdf by HTML content instead of remote url. 对于DocRaptor API,我将提供内容以通过HTML内容而不是远程URL生成pdf。

  • So that, i have written the above css code in the html content's style property which will be given to the DocRaptor API. 所以,我已经在html内容的style属性中编写了上面的css代码,该属性将被提供给DocRaptor API。 And if we change the property value of prince-hyphenate-patterns in the html contents to http resource url points to the hyph-ta.pat file 如果我们将html内容中的prince-hyphenate-patterns的属性值更改为http资源url指向hyph-ta.pat文件

     :lang(ta) { hyphens:auto; prince-hyphenate-patterns: url("http://../hyph-ta.pat"); } 

    the hyphenation did not works in generated pdf. 连字符在生成的pdf中不起作用。

Is there any other requirements needed to work the hyphenation in Docraptor API ? 在Docraptor API中使用连字符是否还需要其他任何要求?

Whenever I have given in http resource file for the property "prince-hyphenate-patterns" the hyphenation did not work in generated pdf document in both local environment and in DocRaptor API. 每当我在http资源文件中提供属性“prince-hyphenate-patterns”时,连字在本地环境和DocRaptor API中的生成的pdf文档中都不起作用。

The primary difference between DocRaptor and a local instance of PrinceXML is the fact that DocRaptor's conversion takes place externally on our own servers. DocRaptor与PrinceXML的本地实例之间的主要区别在于DocRaptor的转换是在我们自己的服务器上进行的。

This means that while your local instance of PrinceXML can use your local filesystem to access hyph-ta.pat, DocRaptor cannot. 这意味着虽然您的本地PrinceXML实例可以使用您的本地文件系统来访问hyph-ta.pat,但DocRaptor却不能。 The solution here is that hyph-ta.pat will have to be linked either from a public source, or will have to be externally visible by another means. 这里的解决方案是hyph-ta.pat必须从公共来源链接,或者必须通过其他方式在外部可见。 That is to say, instead of the url being something like "../hyph/hyph-ta.pat" it will need to be something like " https://hyph-pattern-source.com/hyph/hyph-ta.pat " (This is just an example format and not a real URL). 也就是说,而不是像“../hyph/hyph-ta.pat”这样的url,它需要像“ https://hyph-pattern-source.com/hyph/hyph-ta”。 pat “(这只是一个示例格式,而不是真正的URL)。

Let me know if this helps answer your question. 如果这有助于回答您的问题,请与我们联系。 If you need anything else, we're happy to help! 如果您还有其他需求,我们很乐意为您提供帮助!

Best Regards, 最好的祝福,

Jon (who forwarded this response to me) 乔恩(谁将此回复转发给我)

DocRaptor Support Team DocRaptor支持团队

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM