Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set maximum block height and trim content

Tags:

block

xsl-fo

I have a table in an XSL-FO document and in a cell there's an article description, which can easily overflow a page, so I want it to be just cut after reaching a certain height with the cell. Is that possible? This is my example, I tried setting:

height="4cm"

and

block-dimension-progression.maximum="4cm"

but it doesn't work.

<fo:table-row keep-together.within-page="always"  height="2cm">
    <fo:table-cell border-right="1.5pt solid black">
        <fo:block text-align="center">
            <xsl:value-of select="count"/>
        </fo:block>
    </fo:table-cell>
    <fo:table-cell border-right="1.5pt solid black" padding-left="2pt">
        <fo:block>
            <xsl:value-of select="name"/>
        </fo:block>
        <fo:block font-size="10pt"><xsl:value-of select="manufacturer"/> / <xsl:value-of select="identifier"/></fo:block>
        <fo:block font-size="10pt"><xsl:value-of select="description"/></fo:block>
    </fo:table-cell>
    <fo:table-cell border-right="1.5pt solid black" padding-right="2pt">
        <fo:block text-align="right">
            <xsl:value-of select="unitprice"/>
        </fo:block>
    </fo:table-cell>
    <fo:table-cell>
        <fo:block text-align="right">
            <xsl:value-of select="totalprice"/>
        </fo:block>
    </fo:table-cell>
</fo:table-row>
like image 862
Fabian Zeindl Avatar asked Jul 04 '11 16:07

Fabian Zeindl


1 Answers

Put the block with the article description in a block-container with overflow="hidden" and the desired height set. Like this:

<fo:block-container overflow="hidden" height="2cm">
 <fo:block font-size="10pt">Long description text goes here...</fo:block>
</fo:block-container>
like image 144
mzjn Avatar answered Oct 19 '22 08:10

mzjn