title: Debugging Apache fop
body: <p>How to debug xsl-fo layout</p>
  
  <p>I have a table, blocks and one image that is 1mm too far from the outer egde of all this. </p>
  
  <pre><code>&lt;fo:table-row xsl:use-attribute-sets="blue-border"&gt;
        &lt;fo:table-cell &gt;
          &lt;fo:block id="logo" xsl:use-attribute-sets="red-border"&gt;
            &lt;fo:external-graphic src="url('{$headerLogoPath}')" width="100%" content-width="53mm" scaling="uniform" xsl:use-attribute-sets="green-border"/&gt;
          &lt;/fo:block&gt;
        &lt;/fo:table-cell&gt;
        &lt;fo:table-cell text-align="right" margin-right="1mm"&gt;
          &lt;xsl:apply-templates select="/FOO" /&gt;
        &lt;/fo:table-cell&gt;
      &lt;/fo:table-row&gt;
  </code></pre>
  
  <p>And as a result I get following:</p>
  
  <pre><code>_____blue, red___ 
  |______green_____|
  |                |
  |                |
  |______green_____|
  |____blue, red___|
  </code></pre>
  
  <p>How to debug what is causing the spacer? As I understand it may be several things (margin, padding, space). I have tried setting all of these to 0pt for block and graphic but no help.</p>
  
  <p>Something like more advanced AWT preview would be great. I wish it would show all margins, paddings, area borders and area dimensions. Anyone knows such (preferably freeware) tool?</p>