Petter Reinholdtsen commented on FOP-2727:

Thank you very much for looking into this.  The examples and
documentation motivated me to have a closer look at why the xmlto fop
output did not produce a float block.

I discovered that by moving the <fo:float> inside a <fo:block>, the text
show up in the PDF.

In other words, instead of having XML like this:

        <fo:block ...>Some text in front of the sidebar.</fo:block>
      <fo:float float="start" clear="both">...</fo:float>

I changed it to look like this:

        <fo:block ...>Some text in front of the sidebar.</fo:block>
        <fo:float float="start" clear="both">...</fo:float>

Unfortunately, I have no idea if it is a bug in xmlto or fop.

My docbook example code is based on
<URL: http://www.sagehill.net/docbookxsl/SideFloats.html >, which claim
it is working with RenderX's XEP and Antenna House's XSL Formatter.
Perhaps Apache FOP can work with it too?

Happy hacking
Petter Reinholdtsen

> Please implement sidebars floating at the side of the body of the text
> ----------------------------------------------------------------------
>                 Key: FOP-2727
>                 URL: https://issues.apache.org/jira/browse/FOP-2727
>             Project: FOP
>          Issue Type: Improvement
>          Components: fo/unqualified
>    Affects Versions: 1.1, 2.0, 2.1
>         Environment: Debian Jessie and Stretch.
>            Reporter: Petter Reinholdtsen
>            Priority: Minor
> Hi.  When trying to figure out how to make sure my docbook sidebars end up on 
> the side of the text, I tried following the instructions on <URL: 
> http://www.sagehill.net/docbookxsl/SideFloats.html > and wrote a simple 
> example docbook file to test floating sidebars.  This do not work and I get a 
> message about a missing feature.  Please add support for sidebars placed at 
> the side of the text body.
> When processing my example, I get this message and the sidebar has 
> disappeared from the resulting PDF:
> {noformat}
>  % xmlto --with-fop pdf db-sidebar-test.xml
>   Making portrait pages on letter paper (215.9mmx279.4mm)
>   Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
>   Font "ZapfDingbats,normal,700" not found. Substituting with
> "ZapfDingbats,normal,400".
>   Rendered page #1.
>   Couldn't find hyphenation pattern for lang="en".
>   Rendered page #2.
>   The following feature isn't implemented by Apache FOP, yet: fo:float (on
> fo:float) (No context info available)
>   No LayoutManager maker for class class org.apache.fop.fo.flow.Float
>   Rendered page #3.
>   Rendered page #4.
>   /tmp/user/1000/xmlto.xvMMIW
>   %
> {noformat}
> I tried using both fop 1.1 and 2.1, and both fail to create a PDF with a 
> sidebar.
> This is the example docbook file I use:
> {noformat}
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" 
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
> <book id="index" lang="en">
>   <bookinfo>
>     <title>Test docbook sidebar</title>
>   </bookinfo>
>   <chapter id="installation">
>     <title>Sidebar example</title>
>     <highlights>
>       <para>Some text in front of the sidebar.</para>
>     </highlights>
>     <sidebar> 
>       <title>Sidebar example</title>
>       <?dbfo sidebar-width="1.5in"?><?dbfo float-type="left"?>
>       <para>A <sgmltag class="element">sidebar</sgmltag>
>       can be used to emphasize certain
>       content. It can intrude into
>       the body area, or it can
>       appear in side indents as 
>       a margin note.</para>
>     </sidebar>
>     <para>Some text following the sidebar.</para>
>   </chapter>
> </book>
> {noformat}

This message was sent by Atlassian JIRA

Reply via email to