Search code examples
pdfapache-fopdita-ot

Hyphenation doesn´t work with dita-ot 2.5.1 and Apache FOP


I use dita-ot to render to pdf. Recently, I upgraded from dita-ot 1.8.M2 to 2.5.1 Updating my pdf plugins was quite a bit of work, but the only thing that I don´t get to work properly is hyphenation.

I did it all as described on the Apache website.

The relevant instruction in detail:

"Download the precompiled JAR from OFFO and place it either in the {fop-dir}/lib directory, or in a directory of your choice (and append the full path to the JAR to the environment variable FOP_HYPHENATION_PATH)."

That is how it worked with dita-ot 1.8.M2, where the {fop-dir} was placed in the "org.dita.pdf2" plugin. Now, {fop-dir} is in the "org.dita.pdf2.fop" plugin. Maybe this is the reason, why "fop-hyph.jar" is obviously not found by the process? But what about the environment variable?

Has anybody a solution?


Solution

  • I found the solution by myself: I just added the attribute <xsl:attribute name="hyphenate">true</xsl:attribute> to the attribute set common.block inside of the attribute file commons-attr.xsl.

    I found out that not FOP or the jar file is the cause, when I compared a FO file generated with the old dita-ot (with hyphenation) to a FO file of the new dita-ot. What was missing was the hyphenate=true attribute in each block.

    Thanks for your patience!