xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Sargent <rsarg...@xmission.com>
Subject Does fop-1.1 block-container respect "top" attribute?
Date Tue, 27 Aug 2013 23:24:22 GMT
I cannot seem to push a block down using 'top="n"' set to any value n > 
0 (and < 1 of course)

I've even added an extra, enclosing (superfluous?) block-container 
inside the table-cell. "left" and "right" are working just fine but 
"top" not so much.

I thought this was a compliant piece of FOP.  Am I wrong about that or 
just doing something stupid again. (Hey, I've been away awhile).

Thanks.

My xsl: this template is called as the table-cell is laid out.

     <xsl:template name="scout-image">
         <xsl:param name="curpage"/>
         <xsl:param name="curpos"/>
         <xsl:param name="imageCount"/>
         <xsl:if test="contains($curpage/@layout-id, 'scout') and 
count($curpage/image[@pos = $imageCount + $curpos]) = 1">
             <xsl:variable name="scoutsize">
                 <xsl:choose>
                     <xsl:when test="$imageCount = 3">
                         <xsl:value-of select="number(0.9)"/>
                     </xsl:when>
                     <xsl:when test="$imageCount = 1">
                         <xsl:value-of select="number(1.0)"/>
                     </xsl:when>
                     <xsl:otherwise>
                         <xsl:value-of select="number(1.25)"/>
                     </xsl:otherwise>
                 </xsl:choose>
             </xsl:variable>
             <fo:block-container>
             <fo:block-container position="absolute" z-index="-1" 
height="{$scoutsize}in" width="{$scoutsize}in">
                 <xsl:choose>
                     <xsl:when test="$curpage/@pos mod 2 = 0">
                         <xsl:attribute name="left">
                             <xsl:value-of select="0"/>
                         </xsl:attribute>
                     </xsl:when>
                     <xsl:otherwise>
                         <xsl:attribute name="right">
                             <xsl:value-of select="0"/>
                         </xsl:attribute>
                     </xsl:otherwise>
                 </xsl:choose>
                 <xsl:choose>
                     <xsl:when test="$imageCount = 1">
                         <xsl:attribute name="top">
                             <xsl:value-of select="0.1"/>
                         </xsl:attribute>
                     </xsl:when>
                     <xsl:otherwise>
                         <xsl:attribute name="top">
                             <xsl:value-of select="0"/>
                         </xsl:attribute>
                     </xsl:otherwise>
                 </xsl:choose>

                 <xsl:call-template name="show-image">
                     <xsl:with-param name="img" 
select="$curpage/image[@pos= $curpos + $imageCount]" />
                     <xsl:with-param name="width" select="$scoutsize" />
                     <xsl:with-param name="height" select="$scoutsize" />
                     <xsl:with-param name="addBlack" select="false()" />
                 </xsl:call-template>
             </fo:block-container>
             </fo:block-container>
         </xsl:if>
     </xsl:template>


My fop:
  <fo:table-cell>
    <fo:block-container>
       <fo:block-container width="1in" height="1in" z-index="-1" 
position="absolute" left="0" top="0.1">
           <fo:block>
             <fo:external-graphic border-collapse="separate" 
content-height="1in" content-width="1in" display-align="center" 
src="ref_scout_3_0_650043924" />
           </fo:block>
       </fo:block-container>
    </fo:block-container>
    <fo:block-container width="1.2102857142857144in" 
top="3.9297774842857143in" position="absolute" left="0.0in" height="0.6in">
       <fo:block linefeed-treatment="preserve" 
white-space-collapse="false" font-size="8pt" 
font-family="StoneSerif">Anterior surface of patella</fo:block>
    </fo:block-container>
    <fo:block-container width="1.2102857142857144in" 
top="5.698118852857143in" position="absolute" left="0.0in" height="0.6in">
        <fo:block linefeed-treatment="preserve" 
white-space-collapse="false" font-size="8pt" 
font-family="StoneSerif">Patellar tendon</fo:block>
    </fo:block-container>
       <fo:block-container width="1.2102857142857144in" 
top="2.4832606942857147in" position="absolute" left="0.0in" height="0.6in">
          <fo:block linefeed-treatment="preserve" 
white-space-collapse="false" font-size="8pt" 
font-family="StoneSerif">Quadriceps tendon</fo:block>
       </fo:block-container>
  </fo:table-cell>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message