hyphenationprincexml

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


I have installed prince xml in local environment in linux.

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.

: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.

Is there any other requirements needed to work the hyphenation in 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.


Solution

  • 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.

    This means that while your local instance of PrinceXML can use your local filesystem to access hyph-ta.pat, DocRaptor cannot. 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. 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).

    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