You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by wmurrill <gs...@yahoo.com> on 2007/03/28 20:09:16 UTC

table break with missing borders

Hi, I'm trying to migrate from fop-0.20.3 to
fop-trunk.  We use fop to produce a final report. 
With fop-trunk and java 1.4 (also java 1.5), fop
splits tables
across pages (as it should) but does not draw the
bottom border for the table on page 1 nor the top
border for the table on page 2.  Without the
bottom/top borders, the report does not look as
professional as it should.  The border to outline the
table is assigned to a fo:table element.  Borders are
not drawn around each table-row or table-cell in the
table-body portion of the table.  

A separate problem with the table borders is how they
seem to vary in width or boldness.  The borders
applied are consistent ie border-style="solid"
border-width="0.5pt" border-color="red"; yet, after
rendering in pdf, the vertical border between column 1
and column 2 varies in width/boldness from header row
1 to row2; also, on the 2nd page, the border under
column 1 header is noticably wider/bolder than borders
under column 2 and 3.  I rendered to pdf using: java
org.apache.fop.cli.Main break.fo break.pdf

I have included the .fo file used to produce the pdf,
but not the pdf itself.  The included .fo is contrived
but illustrates the problem we are having with final
reports; it is worked up
from examples/fo/tables/break.fo. ex:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="first"
      margin-right="1.5cm"
      margin-left="1.5cm"
      margin-bottom="2cm"
      margin-top="1cm"
      page-width="21cm"
      page-height="17cm">
      <fo:region-body margin-top="1cm"/>
      <fo:region-before extent="1cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="first">
    <fo:static-content flow-name="xsl-region-before">
      <fo:block line-height="14pt" font-size="10pt"
    text-align="end">table examples</fo:block>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-after">
      <fo:block line-height="14pt" font-size="10pt"
    text-align="end">Page <fo:page-number/></fo:block>
    </fo:static-content>

    <fo:flow flow-name="xsl-region-body">

      <fo:block space-before.optimum="3pt"
space-after.optimum="15pt">
      Tests for breaks on table rows.
      </fo:block>

      <fo:block space-before.optimum="80pt"
space-after.optimum="15pt">
      Table 1: basic break after with next
      </fo:block>

      <fo:table border-width="0.5pt"
border-color="red" border-style="solid"
table-layout="fixed" width="9cm">
  <fo:table-column column-width="3cm"/>
  <fo:table-column column-width="3cm"/>
  <fo:table-column column-width="3cm"/>

    <fo:table-header>
    <fo:table-row>
      <fo:table-cell>
        <fo:block text-align="center">
       colhdr 1, 1
        </fo:block>
      </fo:table-cell>
      <fo:table-cell border-left-width="0.5pt"
border-left-color="red" border-left-style="solid">
        <fo:block text-align="center">
       colhdr 1, 2
        </fo:block>
      </fo:table-cell>
      <fo:table-cell border-left-width="0.5pt"
border-left-color="red" border-left-style="solid">
        <fo:block text-align="center">
       colhdr 1, 3
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
      <fo:table-cell border-after-width="0.5pt"
border-after-color="red" border-after-style="solid">
        <fo:block text-align="center">
       colhdr 2, 1
        </fo:block>
      </fo:table-cell>
      <fo:table-cell border-after-width="0.5pt"
border-after-color="red" border-after-style="solid"
border-left-width="0.5pt" border-left-color="red"
border-left-style="solid">
        <fo:block text-align="center">
       colhdr 2, 2
        </fo:block>
      </fo:table-cell>
      <fo:table-cell border-after-width="0.5pt"
border-after-color="red" border-after-style="solid"
border-left-width="0.5pt" border-left-color="red"
border-left-style="solid">
        <fo:block text-align="center">
       colhdr 2, 3
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
    </fo:table-header>

    <fo:table-body>
    <fo:table-row border-width="0.5pt"
break-after="page">
      <fo:table-cell>
        <fo:block text-align="center">
        first row
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block text-align="center">
        new page
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block text-align="center">
        for next
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
    <fo:table-row border-width="0.5pt">
      <fo:table-cell>
        <fo:block text-align="center">
        second row
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block text-align="center">
        normal
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block text-align="center">
        row
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
      </fo:table>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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


Re: table break with missing borders

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Mar 28, 2007, at 20:09, wmurrill wrote:

Hi,

> Hi, I'm trying to migrate from fop-0.20.3 to
> fop-trunk.  We use fop to produce a final report.
> With fop-trunk and java 1.4 (also java 1.5), fop
> splits tables across pages (as it should) but does
> not draw the bottom border for the table on page 1
> nor the top border for the table on page 2.

Indeed, that is the expected behaviour. FOP Trunk is much more  
compliant to the XSL Recommendation in this respect.

In short, you need to drop the border-shorthand on the table, and  
replace it with border-after/before/start/end. Most important are  
border-before-width and border-after-width, that need to specified as:
border-*-width.length="0.5pt"
border-*-width.conditionality="retain"

If you specify them by means of the shorthands (border, border- 
width...) or corresponding properties (border-top-width, border- 
bottom-width...), then the .conditionality component defaults to  
"discard" and cannot be overridden by using the extended, native XSL  
properties.

> A separate problem with the table borders is how they
> seem to vary in width or boldness.  The borders
> applied are consistent ie border-style="solid"
> border-width="0.5pt" border-color="red";

Hmm... that's very strange indeed. There's /something/ different  
between the two borders you describe, but I only see it distinctly at  
either very low or very high zoom. It seems like a difference of a  
pixel or something. I'd have to take a real close look at this to say  
what's going on. AFAICT, so this seems to be related to the border- 
rendering.

Try applying what I mentioned above, and instead of specifying  
borders only on the start- or end-edges, specify half the border on  
both.

HTH!

Cheers,

Andreas




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