You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Bradley Harrington <bh...@us.ibm.com> on 2006/12/01 19:54:54 UTC

Re: Problems with display-align

Jeremias,
      I played with it a little more.  I realized that if I get the static
content overflow warning, then the cell alignment drops to default.
However, I got that warning even though the image I embedded in the header
is smaller than the before-extent (0.5in vs. 0.45in).  I am assuming the
table is creating the extra space to cause the overflow.  If I change the
image size to 0.4in, things work correctly.  Here is the stylesheet and the
warning generated. I don't know if this is a bug for you or not.  Thanks
for the help though, I would've never figured this out on my own.

--Brad
-------------------------------------------------------------------------------------------------

Dec 1, 2006 12:52:54 PM org.apache.fop.layoutmgr.PageBreakingAlgorithm
updateData2
WARNING: Part/page 1 overflows the available area in block-progression
dimension. (fo:static-content, "After")
Dec 1, 2006 12:52:54 PM org.apache.fop.layoutmgr.StaticContentLayoutManager
doLayout
WARNING: static-content overflows the available area. (fo:static-content,
"After")


-------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
  <xsl:output method="xml" version="1.0" omit-xml-declaration="no"
indent="yes"/>
  <xsl:param name="versionParam" select="'1.0'"/>
  <!-- ========================= -->
  <!-- root element: projectteam -->
  <!-- ========================= -->
  <xsl:template match="projectteam">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="first-page" page-height="11in"
                     page-width="8.5in" margin-top="0.5in"
                     margin-bottom="0.5in" margin-left="1in"
margin-right="1in">
          <fo:region-body/>
          <fo:region-before extent="0.5in"/>
          <fo:region-after extent="2in"/>
        </fo:simple-page-master>

        <fo:simple-page-master master-name="all-pages" page-height="11in"
page-width="8.5in" margin-top="0.5in"
                     margin-bottom="0.5in" margin-left="1in"
margin-right="1in">
          <fo:region-body margin-top="1in" margin-bottom="0.5in"/>
          <fo:region-before extent="0.5in"/>
          <fo:region-after extent="0.5in"/>
        </fo:simple-page-master>

      </fo:layout-master-set>


      <!-- ========================= -->
      <!-- first-page:               -->
      <!-- ========================= -->
      <fo:page-sequence master-reference="first-page">
        <!-- ========================= -->
        <!-- first-page: Header        -->
        <!-- ========================= -->
        <fo:static-content flow-name="xsl-region-before">
          <fo:block font-size="10pt">
            <fo:table table-layout="fixed" width="100%">
              <fo:table-column column-width="50%"/>
              <fo:table-column column-width="50%"/>
              <fo:table-body>
                <fo:table-row>
                  <fo:table-cell display-align="after">
                    <fo:block>
                      After
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell text-align="right">
                    <fo:block>
                      <fo:external-graphic src="url('IBM_logo.png')"
scaling="uniform" content-height=".45in"/>
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </fo:table-body>
            </fo:table>
          </fo:block>
        </fo:static-content>
        <!-- ========================= -->
        <!-- first-page:   Footer      -->
        <!-- ========================= -->
        <fo:static-content flow-name="xsl-region-after">
          <fo:block>
          </fo:block>
        </fo:static-content>

        <!-- ========================= -->
        <!-- first-page:   Body        -->
        <!-- ========================= -->
        <fo:flow flow-name="xsl-region-body" font-family="Times Roman">
          <fo:block>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
     </fo:root>
  </xsl:template>
</xsl:stylesheet>







Re: Problems with display-align

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Bradley Harrington wrote:
> However, I got that warning even though the image I embedded in the header
> is smaller than the before-extent (0.5in vs. 0.45in).  I am assuming the
> table is creating the extra space to cause the overflow.

FOP puts images into lines, like everything else, and adds additional
space (the half-leading) before and after the line. The half-leading
is calculated from the line height, which is in turn calculated from
the font size in effect at the beginning of the block, unless
explicitly overridden. If you want to take the line exactly as much 
height as the image set the line-height or font-size to 0. (if you put
text in such lines, they will look "glued" together)

J.Pietschmann