On Sep 22, 2008, at 07:08, Yang SongXiang wrote:

Hi

I put some code in <programlisting>, but seems they are too long,  the
PDF output is out of boundary of page

My sample DocBook XML file is like this:
---------------------------------
<programlisting>This is too long line too long line too long line too
long line too long line too long line too long line too long line too
long line<programlisting>
---------------------------------

How can I control the out of boundary programlisting to be auto-wrap?

IIC, then the template for a <programlisting> will yield a FO result like:

<fo:block white-space-treatment="preserve" linefeed-treatment="preserve"
          white-space-collapse="false" wrap-option="no-wrap">
...

Setting the wrap-option property makes it prohibited for the formatter to insert implicit line-breaks. (see: http://www.w3.org/TR/ xsl/#wrap-option)

Removing this property would allow FOP to break the lines, but....

Note that the result of allowing implicit line-breaks in pre- formatted code blocks will probably be suboptimal. If you have something like:

    [... a very long indented line of code ...]
    [... next line ...]

The formatter will keep the white-space indentation for the first line, but the second line will have no leading white-space, so you may end up with something looking like:

   [... a very long indented
line of code ...]
   [... next line ...]



HTH!

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to