Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSL-FO: Set fixed block height

Is there any way I can set a fixed height for a block regardless of the content within it? I have a block which sometimes displays some text but sometimes it needs to be empty and keep the same height:

<xsl:choose>
    <xsl:when test="$condition">
       <fo:block height="30mm">
          <xsl:text>TEXTTEXT</xsl:text>
       </fo:block>
    </xsl:when>
    <xsl:otherwise>
       <fo:block height="30mm">
          <xsl:text>&#160;</xsl:text>
       </fo:block>
    </xsl:otherwise>
</xsl:choose>
like image 475
Mihnea Mihai Avatar asked Nov 27 '13 08:11

Mihnea Mihai


1 Answers

The height attribute does not apply to fo:block. To keep a fixed height, wrap the fo:block in a fo:block-container:

<fo:block-container height="30mm">
 <fo:block>
   <xsl:text>&#160;</xsl:text>
 </fo:block>
</fo:block-container>
like image 147
mzjn Avatar answered Oct 19 '22 22:10

mzjn