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&amp;spaces=MYTHING&amp;maxResults=15&amp;title=%5Bsomething+sitting%5D+Pages+Feed&amp;someotherthing=false&amp;os&#8203;_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&#8203;=&#8203;page&amp;spaces&#8203;=&#8203;MYTHING&amp;maxResults&#8203;=15&amp;title&#8203;=%5Bsomething+sitting%5D+Pages+Feed&amp;someotherthing=false&amp;os&#8203;_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&amp;spaces=MYTHING&amp;maxResults=15&amp;title=%5Bsomething+sitting%5D+Pages+Feed&amp;someotherthing=false&amp;os&#8203;_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]<mailto:[email protected]> | Skype: 
stadler.dominik
dynaTrace is Continuous APM >> Monitor. Resolve. Prevent. >>
Web: http://www.dynatrace.com<http://www.dynatrace.com/> | Blog: 
http://blog.dynatrace.com<http://blog.dynatrace.com/>
Learn about dynaTrace in 2 
minutes<http://www.dynatrace.com/twominutedemo/Default.aspx> | Forrester rates 
dynaTrace "On 
Fire"<http://applicationperformance.dynatrace.com/Forrester_Business_Transaction_Management_Report.html>.
 Get your copy of the report 
here<http://applicationperformance.dynatrace.com/Forrester_Business_Transaction_Management_Report.html>.
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.

Reply via email to