This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: callouts and spacing with fo


Title: Re: DOCBOOK-APPS: callouts and spacing with fo

Actually, I've ruled out tabs as the problem (tested it again after doing an untabify on the whole buffer), as well as my original theory about < vs. &lt;. I've simplified the test further (see below). The result is the same: lineone is correct. In the case of linetwo-linefive, in the .fo output, I get: "linetwo" followed by the number of spaces necessary to put the callout in column 45, followed by a linebreak, followed by about 11 spaces.

I'm using Saxon 6.2.2 (though I get the same result with 5.5.1). I'm using the following customization layer for the fo/docbook.xsl stylesheets (param.xsl has not been modified):

<xsl:import href=""./fo/docbook.xsl"/>
<xsl:param name="saxon.extensions" select="'1'"/>
<xsl:param name="callout.graphics" select="'1'"/>  <!-- I've tried 0 too-->
<xsl:param name="callout.graphics.extension" select="'.gif'"/> <!-- I've tried png too-->

I'm using Apache fop 0.17.0. I couldn't tell if they support pngs, but it looks like it supports gifs. In both cases, when I run it, it reports:

Error while creating area : no protocol: ../images/callouts/1.png...
or for gifs:
Error while creating area : no protocol: ../images/callouts/1.gif...

I'm mystified. In some ways, I like the idea of using <co id="foo"/> better in the listing, but I can't get those to work with Saxon or Xalan-c. It's a big help just to hear that programlistingco is supposed to work with fo (they work fine for me with html). I'm just not sure what to try next.

Thanks,
David

XML source:

      <programlistingco>
        <areaspec>
          <area units="linecolumn" coords="1 45" id="foo.one"/>
          <area units="linecolumn" coords="2 45" id="foo.two"/>
          <area units="linecolumn" coords="3 45" id="foo.three"/>
          <area units="linecolumn" coords="4 45" id="foo.four"/>
          <area units="linecolumn" coords="5 45" id="foo.five"/> 
        </areaspec>
<programlisting>lineone
linetwo
linethree
linefour
linefive
</programlisting>
    <calloutlist>
    <callout arearefs="foo.one">
      <para>
        Foo one.
      </para>
    </callout>
    <callout arearefs="foo.two">
      <para>
        Foo two.
      </para>
    </callout>
    <callout arearefs="foo.three">
      <para>
        Foo three.
      </para>
    </callout>
    <callout arearefs="foo.four">
      <para>
        Foo four.
      </para>
    </callout>
    <callout arearefs="foo.five">
      <para>
        Foo five.
      </para>
    </callout>
  </calloutlist>
</programlistingco>


FO output:

<fo:block wrap-option="no-wrap" text-align="start" white-space-collapse="false" linefeed-treatment="preserve" font-family="Courier" space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em">lineone                                     <span class="callout">(1)</span>

linetwo                                    
            <span class="callout">(2)</span>
linethree                                  
            <span class="callout">(3)</span>
linefour                                   
            <span class="callout">(4)</span>
linefive                                   
            <span class="callout">(5)</span>

         </fo:block>

--
512.908.1645

> / David Cramer <david_cramer@broadjump.com> was heard to say:
> | the right place, but numbers 4-5 are off by one line plus some spaces. This
> | must have something to do with the fact that the < and > signs are changed
> | to &lt; and &gt; in the fo output, but that there is only one tag on line
> | one of the listing, and two tags (and so two pairs of <>) on lines 3-5 of
> | the listing.
>
> Nope. The problem is that you've used tab characters to indent the lines
> of your program listing and tab characters only "count" as one space but
> they often generate more than one space character's width of stuff in the
> output.
>
> Avoid tabs.
>
> | A second question: The references to the graphics show up in the .fo file
> | (<img src=""../images/callouts/4.png"" alt="(4)"/> and they are in
> | ../images/callouts/ relative to the fo document, but they don't ever appear
> | in the .pdf.
>
> What FO processor are you using? Does it support PNGs?
>
>                                        Be seeing you,
>                                          norm


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]