I struggled with this for a while when I first implemented it. Here is
some sample code that works (on 0.94):
<fo:block-container overflow="hidden" height="8pt">
<fo:block font-size="8pt">
<xsl:apply-templates select="reportHeader"/>
</fo:block>
</fo:block-container>
-Lou
"Amick, Eric" <[email protected]> wrote on 08/12/2010 08:13:45 AM:
> You’re right about block-container. Furthermore, the standard says
> overflow does not apply to table-row and is not inherited, so the
> behavior seen originally is correct.
>
> Eric Amick Systems Engineer II
> Legislative Computer Systems
>
> From: Jonathan Levinson [mailto:[email protected]]
> Sent: Thursday, August 12, 2010 7:48
> To: [email protected]
> Subject: RE: Why does overflow="hidden" not cut off the content?
>
> I believe overflow=”hidden” works on an fo:block-container. If you
> surround the contents of your table-cell with an fo:block-container
> text will truncated rather than overflowing into other columns.
>
> Best Regards,
> Jonathan Levinson
>
> From: Dominik Stadler [mailto:[email protected]]
> Sent: Thursday, August 12, 2010 2:36 AM
> To: [email protected]
> Subject: Why does overflow="hidden" not cut off the content?
>
> Hi,
>
> I am struggling to understand how overflow=“hidden“ works in FOP.
> When I read the description in the FO-standard [1], it states that
> overflow=”hidden” causes text to be cut off when it overflows the
region.
>
> Now when I try to use this in FOP 0.95 (same in 1.0) to get a clean
> table-layout in favour of displaying all data, I do not get what I
> expect, text is still overflowing both into other columns and also
> into the margin-right region. How do I stop FOP from doing that? Or
> is this a known Bug/Limitation in FOP?
>
> I know that I could add “invisible blanks” at certain places to make
> it wrap around here, however these are automatically generated XSL-
> FO files where I can not fully control the incoming data, so for
> some cases I would rather really actually cut off the data.
>
> The XSL-FO below shows my latest attempt. I get the following
> warnings when running FOP, which is expected here as things
> overflow. The attached test.pdf shows the result with fop-0.95, I am
> going to try fop-1.0 now.
>
> 12.08.2010 08:24:29 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 5 of a paragraph overflows the available area by more
> than 50 points. (fo:block, location: 33/44)
> 12.08.2010 08:24:30 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 1 of a paragraph overflows the available area by more
> than 50 points. (fo:block, location: 33/44)
> 12.08.2010 08:24:30 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 8 of a paragraph overflows the available area by more
> than 50 points. (fo:block, location: 44/44)
> 12.08.2010 08:24:30 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 3 of a paragraph overflows the available area by
> 31268mpt. (fo:block, location: 44/44)
> 12.08.2010 08:24:30 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 1 of a paragraph overflows the available area by
> 9644mpt. (fo:block, location: 55/44)
> 12.08.2010 08:24:30 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 5 of a paragraph overflows the available area by more
> than 50 points. (fo:block, location: 66/44)
> 12.08.2010 08:24:30 org.apache.fop.layoutmgr.inline.
> LineLayoutManager$LineBreakingAlgorithm updateData2
> WARNUNG: Line 1 of a paragraph overflows the available area by more
> than 50 points. (fo:block, location: 66/44)
>
> [1] http://www.w3.org/TR/xsl/#overflow
>
> Thanks… Dominik
>
> <?xml version="1.0" encoding="utf-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="
> http://xmlgraphics.apache.org/fop/extensions">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="A4-portrait" page-
> height="29.7cm" page-width="21cm" margin-top="1cm" margin-
> bottom="1cm" margin-left="2.5cm" margin-right="2.5cm">
> <fo:region-body/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence master-reference="A4-portrait">
> <fo:flow id="top" flow-name="xsl-region-body" language="en"
> hyphenate="true">
> <fo:table table-layout="fixed" width="100%" border-
> style="solid" border-width="0.5pt">
> <fo:table-column column-width="66%" />
> <fo:table-column column-width="21%" />
> <fo:table-column column-width="13%" />
> <fo:table-header>
> <fo:table-row overflow="hidden">
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">Content</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">String</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">Number</fo:block>
> </fo:table-cell>
> </fo:table-row>
> </fo:table-header>
> <fo:table-body>
> <fo:table-row overflow="hidden">
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">One long argument without
> blanks</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt" >
> <fo:block overflow="hidden">types=page&
> spaces=MYTHING&maxResults=15&title=%5Bsomething+sitting%
>
5D+Pages+Feed&someotherthing=false&os​_authType=basic</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">3249,69</fo:block>
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row overflow="hidden">
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">One long argument with
> "invisible blanks" to get some hyphenation</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">types​=​
> page&spaces​=​MYTHING&maxResults​=15&
> title​=%5Bsomething+sitting%5D+Pages+Feed&
> someotherthing=false&os​_authType=basic</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">3249,69</fo:block>
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row overflow="hidden">
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">Some short text</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">os_authType=basic</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">2924,98</fo:block>
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row overflow="hidden">
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">Some long text with
> background set to white to show cutting off in this case</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" background-
> color="rgb(255, 255, 255)">
> <fo:block overflow="hidden">types=page&
> spaces=MYTHING&maxResults=15&title=%5Bsomething+sitting%
>
5D+Pages+Feed&someotherthing=false&os​_authType=basic</fo:block>
> </fo:table-cell>
> <fo:table-cell overflow="hidden" border-style="solid"
> border-width="0.5pt">
> <fo:block overflow="hidden">2924,98</fo:block>
> </fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
>
> Dominik Stadler, Team Lead
> F +43 732 210100008 | E [email protected] | Skype:
stadler.dominik
> dynaTrace is Continuous APM >> Monitor. Resolve. Prevent. >>
> Web: http://www.dynatrace.com | Blog: http://blog.dynatrace.com
> Learn about dynaTrace in 2 minutes | Forrester rates dynaTrace “On Fire”
> . Get your copy of the report here.
> This e-mail message, including any attachments, is confidential and
> may contain legally privileged information. This message is intended
> solely for the use of the addressee. Use by others is prohibited.
> Disclosure, copying and distribution of this information to third
> parties is not permitted. If you have received this message in
> error, please notify us immediately and delete it from your system.
> The integrity and security of this message cannot be guaranteed and
> it may be subject to data corruption, interception and unauthorized
> amendment, for which we accept no liability.
>