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 dbtool <db...@networld.at> on 2008/09/28 23:47:32 UTC

Re: table border irregularity

Hi,

I have the same problem.  http://www.nabble.com/file/p19715842/preview.pdf
preview.pdf  shows the mentioned behaviour and 
http://www.nabble.com/file/p19715842/preview_without_bgcolor.pdf
preview_without_bgcolor.pdf  shows the same output but without background
color for the table cell elements. It looks like the background is painted
over the borders.  http://www.nabble.com/file/p19715842/preview.fo
preview.fo  and 
http://www.nabble.com/file/p19715842/preview_without_bgcolor.fo
preview_without_bgcolor.fo  contain the XSL:FO code for the two PDF
documents. By pressing CTRL+5 (Adobe Reader 8) the irregularity is clearly
visible in preview.pdf. Without the background color the borders are painted
correctly, but there are still some gaps between rows.

There are many nested tables which are generated by a report generator which
gets the data from a database, so there is no easier way to generate the
desired output. I'm using the last trunk version of FOP (revision 681373). I
am thankful for any suggestions!
-- 
View this message in context: http://www.nabble.com/table-border-irregularity-tp4021288p19715842.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: table border irregularity

Posted by dbtool <db...@networld.at>.
Hi,

thank you for the fast reply!


Vincent Hennebert-2 wrote:
> 
> Hi,
> 
> FOP definitely paints borders over backgrounds; what you’re seeing is
> a rendering defect of your PDF viewer, partly due to the relatively big
> size of pixels on monitors. The printed document should look ok.
> 
> The gaps between borders are due to the fact that they don’t come from
> the same tables. Basically, you have the following scheme:
> – a table-cell with borders specified on the left and bottom sides;
> – a table-cell on the next row with no border specified
>   – containing /another/ table, a child row and a child table-cell with
>     borders specified on the left and bottom sides.
> 
> This is what creates the discontinuity between borders. See the attached
> FO file as an illustration. Granted, FOP could be a little smarter in
> painting the borders, but this is a rather corner case. Specify borders
> on all the sides of the cells and the issue vanishes.
> 
> FWIW, your FO file really, really contains a lot of tables, most of them
> having no effect on the layout. Note that this may seriously degrade the
> performances of FOP. It may be worth considering to optimize the
> generator a bit.
> 
> HTH,
> Vincent
> 
> <?xml version="1.0" standalone="no"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>   <fo:layout-master-set>
>     <fo:simple-page-master master-name="page" page-height="10cm"
> page-width="15cm" margin="1cm">
>       <fo:region-body background-color="#F0F0F0"/>
>     </fo:simple-page-master>
>   </fo:layout-master-set>
>   <fo:page-sequence master-reference="page">
>     <fo:flow flow-name="xsl-region-body">
>       <fo:block space-after="10pt">Before the table</fo:block>
>       <fo:table width="100%" table-layout="fixed"
> 	border-collapse="collapse">
>         <fo:table-body>
>           <fo:table-row>
>             <fo:table-cell border="4pt solid black">
>               <fo:block>A cell with borders</fo:block>
>             </fo:table-cell>
>           </fo:table-row>
>           <fo:table-row>
>             <fo:table-cell>
>               <fo:block>A cell without borders</fo:block>
>             </fo:table-cell>
>           </fo:table-row>
>           <fo:table-row>
>             <fo:table-cell border="4pt solid black">
>               <fo:block>A cell with borders</fo:block>
>             </fo:table-cell>
>           </fo:table-row>
>         </fo:table-body>
>       </fo:table>
>     </fo:flow>
>   </fo:page-sequence>
> </fo:root>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 

The printed document looks good so far ... I was not sure whether this is a
FOP rendering bug or just a rendering defect of the PDF viewer so I thought
a posting here would be wise.

The bunch of tables is a result due to specific requirements of the report
generator. But optimizing the generator will soon get a priority task.
Thanks again for your advice ;)

-- 
View this message in context: http://www.nabble.com/table-border-irregularity-tp4021288p19722559.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: Setting a different border style on particular table cells [was: table border irregularity]

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Laurent,

Laurent Morel wrote:
> Vincent Hennebert a écrit :
>> FOP definitely paints borders over backgrounds; what you’re seeing is
>> a rendering defect of your PDF viewer, partly due to the relatively big
>> size of pixels on monitors. The printed document should look ok.
>>   
> I have a table related question about that :
> Is that expected that a cell border, once defined as say "1pt solid" at
> a high level
> in the XML hierarchy, can't be redefined as "none" at lower levels ?
> The only way I found to "erase" a border is to change its color to white
> (which is
> not always possible).
> 
> Consider a 50 lines tables like this :
> 
>        +------+
>        | col2 |
> +------+------+
> | foo  | bar  |
> +------+------+
> | foo  | bar  |
> +------+------+
> | foo  | bar  |
> +------+------+
> | foo  | bar  |
> ...
> | foo  | bar  |
> +------+------+
> 
> I would like to specify that all columns
> have left and right borders, except for the first line.
> 
> Thus the table could start with :
> <fo:table-column border="1pt solid">
> <fo:table-body>
>   <fo:table-row border="1pt solid">
>     <fo:table-cell border-left="none" border-top="none">
> but this does not work on fop 0.95.
> 
> Thus I have to specify the left border on each first cell
> (first row excepted), and this is annoyning...
> 
> Would you recommend a solution for this problem ?

Use border-*-style="hidden" instead of "none". This gives the border
precedence over any other (here, the borders specified on the enclosing
table-row and table-column elements). "none" gives the lowest priority,
so if other elements specify borders they will be selected instead.

HTH,
Vincent

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


Re: table border irregularity

Posted by Laurent Morel <la...@al6.fr>.
Vincent Hennebert a écrit :
> FOP definitely paints borders over backgrounds; what you’re seeing is
> a rendering defect of your PDF viewer, partly due to the relatively big
> size of pixels on monitors. The printed document should look ok.
>   
I have a table related question about that :
Is that expected that a cell border, once defined as say "1pt solid" at 
a high level
in the XML hierarchy, can't be redefined as "none" at lower levels ?
The only way I found to "erase" a border is to change its color to white 
(which is
not always possible).

Consider a 50 lines tables like this :

       +------+
       | col2 |
+------+------+
| foo  | bar  |
+------+------+
| foo  | bar  |
+------+------+
| foo  | bar  |
+------+------+
| foo  | bar  |
...
| foo  | bar  |
+------+------+

I would like to specify that all columns
have left and right borders, except for the first line.

Thus the table could start with :
 <fo:table-column border="1pt solid">
 <fo:table-body>
   <fo:table-row border="1pt solid">
     <fo:table-cell border-left="none" border-top="none">
but this does not work on fop 0.95.

Thus I have to specify the left border on each first cell
(first row excepted), and this is annoyning...

Would you recommend a solution for this problem ?




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


Re: table border irregularity

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi,

dbtool wrote:
> Hi,
> 
> I have the same problem.  http://www.nabble.com/file/p19715842/preview.pdf
> preview.pdf  shows the mentioned behaviour and 
> http://www.nabble.com/file/p19715842/preview_without_bgcolor.pdf
> preview_without_bgcolor.pdf  shows the same output but without background
> color for the table cell elements. It looks like the background is painted
> over the borders.  http://www.nabble.com/file/p19715842/preview.fo
> preview.fo  and 
> http://www.nabble.com/file/p19715842/preview_without_bgcolor.fo
> preview_without_bgcolor.fo  contain the XSL:FO code for the two PDF
> documents. By pressing CTRL+5 (Adobe Reader 8) the irregularity is clearly
> visible in preview.pdf. Without the background color the borders are painted
> correctly, but there are still some gaps between rows.
> 
> There are many nested tables which are generated by a report generator which
> gets the data from a database, so there is no easier way to generate the
> desired output. I'm using the last trunk version of FOP (revision 681373). I
> am thankful for any suggestions!

FOP definitely paints borders over backgrounds; what you’re seeing is
a rendering defect of your PDF viewer, partly due to the relatively big
size of pixels on monitors. The printed document should look ok.

The gaps between borders are due to the fact that they don’t come from
the same tables. Basically, you have the following scheme:
– a table-cell with borders specified on the left and bottom sides;
– a table-cell on the next row with no border specified
  – containing /another/ table, a child row and a child table-cell with
    borders specified on the left and bottom sides.

This is what creates the discontinuity between borders. See the attached
FO file as an illustration. Granted, FOP could be a little smarter in
painting the borders, but this is a rather corner case. Specify borders
on all the sides of the cells and the issue vanishes.

FWIW, your FO file really, really contains a lot of tables, most of them
having no effect on the layout. Note that this may seriously degrade the
performances of FOP. It may be worth considering to optimize the
generator a bit.

HTH,
Vincent