Page 1 of 1

FO hyphenate.verbatim not working

Posted: Mon Sep 24, 2012 10:21 pm
by jkeys089
When I enable it I get an exception:

Code: Select all

ERROR - Couldn't find hyphenation pattern en
ERROR - Exception
java.lang.IllegalArgumentException: factor < 0; was: -1
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:174)
at org.apache.fop.cli.Main.main(Main.java:205)
So I found another thread which tells me to download some old FOP libs (which I did).
Now there are just hyphens littering my programlisting elements.

I just want programlisting elements to wrap on the page instead of running of the page.

Any help would be very much appreciated.

Re: FO hyphenate.verbatim not working

Posted: Tue Sep 25, 2012 5:00 pm
by jkeys089
Here is the best solution I came up with in case anyone else is having this problem:

Please this code in your docbook_custom.xsl

Code: Select all


    <xsl:template match="d:programlisting">
<fo:block language="en"
wrap-option="wrap"
linefeed-treatment="preserve"
font-family="monospace"
white-space-collapse="false"
white-space-treatment="preserve">
<xsl:apply-templates></xsl:apply-templates>
</fo:block>
</xsl:template>

Re: FO hyphenate.verbatim not working

Posted: Tue Sep 25, 2012 5:57 pm
by sorin_ristache
Hi,

Thank you for letting us know the workaround that you found. The FO transformation should not end with an IllegalArgumentException. This is a bug in the Apache FOP processor. By forcing a wrap inside the fo:block corresponding to a programlisting element you avoided the bug.


Regards,
Sorin