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 JWang <ji...@intertek.com> on 2008/10/29 23:31:03 UTC

upgrading to 0.95 from 0.20.5, several problems

I am trying to upgrade the fop to 0.95 from 0.20.5 to use some of the newly
supported features. I am running into a few problems. I appreciate your
help.

1. The old version displays pdf files nicely. But the lines with the new
version are not displayed evenly. One part of a line in a table can be a lot
darker than another part. Does this has something to do with table cells
collapsing borders or something else?

2. More tables show up than before. We use many layers of nested tables to
put contents in groups. Typically a top-level table contains one table cell
that contains another table. The following example displays two tables in
the old version but 3 tables in the new version. When does FOP display one
table if two tables are nested?

 <fo:flow flow-name="xsl-region-body">
            <fo:block font-size="8pt">
                <fo:table table-layout="fixed" width="100%">
                    <fo:table-column column-width="10.559999999999999in"/>
                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell margin="2pt" padding="2pt"
display-align="center" text-align="left">
                                <fo:table table-layout="fixed" width="100%">
                                    <fo:table-column
column-width="10.559999999999999in"/>
                                    <fo:table-body>
                                        <fo:table-row>
                                            <fo:table-cell
display-align="center" border-collapse="collapse"
                                                          
border-style="solid" border-color="black"
                                                          
border-width=".1mm">
                                                <fo:table
table-layout="fixed" width="100%">
                                                    <fo:table-column
column-width="10.559999999999999in"/>
                                                    <fo:table-body
border-width=".1mm" border-color="black"
                                                                  
border-style="solid">
                                                        <fo:table-row
keep-with-previous="always">
                                                            <fo:table-cell
margin="2pt" padding="2pt"
                                                                          
display-align="center" text-align="left">
                                                                <fo:table
table-layout="fixed" width="100%">
                                                                   
<fo:table-column
                                                                           
column-width="1.4300000000000002in"/>
                                                                   
<fo:table-column
                                                                           
column-width="1.4300000000000002in"/>
                                                                   
<fo:table-column
                                                                           
column-width="1.4300000000000002in"/>
                                                                   
<fo:table-column
                                                                           
column-width="1.4300000000000002in"/>
                                                                   
<fo:table-column column-width="1.65in"/>
                                                                   
<fo:table-column column-width="1.65in"/>
                                                                   
<fo:table-column
                                                                           
column-width="1.4300000000000002in"/>
                                                                   
<fo:table-body>
                                                                       
<fo:table-row
                                                                               
keep-together.within-column="always">
                                                                           
<fo:table-cell border-width=".1mm"
                                                                                          
border-color="black"
                                                                                          
border-style="solid"
                                                                                          
border-collapse="collapse"
                                                                                          
text-align="center"
                                                                                          
display-align="center"
                                                                                          
number-rows-spanned="2">
                                                                               
<fo:block margin="0pt" padding="1pt"
                                                                                         
font-size="8pt"
                                                                                         
white-space-collapse="false">
                                                                                   
Units Of Measurement
                                                                               
</fo:block>
                                                                           
</fo:table-cell>...
-- 
View this message in context: http://www.nabble.com/upgrading-to-0.95-from-0.20.5%2C-several-problems-tp20237183p20237183.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: upgrading to 0.95 from 0.20.5, several problems

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 30.10.2008 00:31:03 JWang wrote:
> 
> I am trying to upgrade the fop to 0.95 from 0.20.5 to use some of the newly
> supported features. I am running into a few problems. I appreciate your
> help.
> 
> 1. The old version displays pdf files nicely. But the lines with the new
> version are not displayed evenly. One part of a line in a table can be a lot
> darker than another part. Does this has something to do with table cells
> collapsing borders or something else?

So you have a screenshot that shows the problem you're seeing? Most
probably, what you're seeing are anti-aliasing effects by Adobe Acrobat.
If those effects go away if you disable "Smooth line art" in Acrobat
Reader, you know what caused this. When printed all should look fine.

> 2. More tables show up than before. We use many layers of nested tables to
> put contents in groups. Typically a top-level table contains one table cell
> that contains another table. The following example displays two tables in
> the old version but 3 tables in the new version. When does FOP display one
> table if two tables are nested?

Having tables with only one column doesn't make much sense. Consider
removing them. If necessary, you can replace them by a block-container
which is more light-weight. Anyway, with only a partial snippet of your
document it is very difficult to guess what effects you're seeing.

>  <fo:flow flow-name="xsl-region-body">
>             <fo:block font-size="8pt">
>                 <fo:table table-layout="fixed" width="100%">
>                     <fo:table-column column-width="10.559999999999999in"/>
>                     <fo:table-body>
>                         <fo:table-row>
>                             <fo:table-cell margin="2pt" padding="2pt"
> display-align="center" text-align="left">
>                                 <fo:table table-layout="fixed" width="100%">
>                                     <fo:table-column
> column-width="10.559999999999999in"/>
>                                     <fo:table-body>
>                                         <fo:table-row>
>                                             <fo:table-cell
> display-align="center" border-collapse="collapse"
>                                                           
> border-style="solid" border-color="black"
>                                                           
> border-width=".1mm">
>                                                 <fo:table
> table-layout="fixed" width="100%">
>                                                     <fo:table-column
> column-width="10.559999999999999in"/>
>                                                     <fo:table-body
> border-width=".1mm" border-color="black"
>                                                                   
> border-style="solid">
>                                                         <fo:table-row
> keep-with-previous="always">
>                                                             <fo:table-cell
> margin="2pt" padding="2pt"
>                                                                           
> display-align="center" text-align="left">
>                                                                 <fo:table
> table-layout="fixed" width="100%">
>                                                                    
> <fo:table-column
>                                                                            
> column-width="1.4300000000000002in"/>
>                                                                    
> <fo:table-column
>                                                                            
> column-width="1.4300000000000002in"/>
>                                                                    
> <fo:table-column
>                                                                            
> column-width="1.4300000000000002in"/>
>                                                                    
> <fo:table-column
>                                                                            
> column-width="1.4300000000000002in"/>
>                                                                    
> <fo:table-column column-width="1.65in"/>
>                                                                    
> <fo:table-column column-width="1.65in"/>
>                                                                    
> <fo:table-column
>                                                                            
> column-width="1.4300000000000002in"/>
>                                                                    
> <fo:table-body>
>                                                                        
> <fo:table-row
>                                                                                
> keep-together.within-column="always">
>                                                                            
> <fo:table-cell border-width=".1mm"
>                                                                                           
> border-color="black"
>                                                                                           
> border-style="solid"
>                                                                                           
> border-collapse="collapse"
>                                                                                           
> text-align="center"
>                                                                                           
> display-align="center"
>                                                                                           
> number-rows-spanned="2">
>                                                                                
> <fo:block margin="0pt" padding="1pt"
>                                                                                          
> font-size="8pt"
>                                                                                          
> white-space-collapse="false">
>                                                                                    
> Units Of Measurement
>                                                                                
> </fo:block>
>                                                                            
> </fo:table-cell>...
> -- 
> View this message in context: http://www.nabble.com/upgrading-to-0.95-from-0.20.5%2C-several-problems-tp20237183p20237183.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 



Jeremias Maerki


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


Re: upgrading to 0.95 from 0.20.5, several problems

Posted by JWang <ji...@intertek.com>.
Thank you both, this is very helpful. I will look into the block-container
concept too.


Andreas Delmelle-2 wrote:
> 
> On Oct 30, 2008, at 20:17, JWang wrote:
> 
> Hi
> 
>>
>> I can make the middle table disappear if I mark margin and padding  
>> to be 0pt
>> of the second table :
>> <fo:table-cell margin="2pt" padding="2pt" display-align="center"
>> text-align="left"> or remove the table altogether. I guess that  
>> partially
>> answers the question...
>>
> 
> Yep, for the reason, see: http://wiki.apache.org/xmlgraphics-fop/ 
> IndentInheritance
> 
> (in response to your earlier post)
>> Logically the two inner tables
>> (units of measurement and tank) belong together in a group, that is  
>> why we
>> put them in one table cell. I guess the real question is under what
>> circumstances FOP displays one table even though there are more  
>> than one in
>> the fo file.
> 
> Never. You can always only mimick that effect, but all tables that  
> are present in the source will always be rendered as separate objects.
> 
> BTW: I notice that you're using "0.1mm" as border-width (/really/  
> thin). If I interpret correctly, FOP 0.95 is actually doing better at  
> preserving the originally specified width, which is a non-integer  
> number of points in the output PDF, which may explain why it is  
> necessary to turn on smoothing in Reader to get the right effect on  
> the screen (pixel-rounding?)
>>
> 
> 
> 
> HTH!
> 
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/upgrading-to-0.95-from-0.20.5%2C-several-problems-tp20237183p20253903.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: upgrading to 0.95 from 0.20.5, several problems

Posted by Andreas Delmelle <an...@telenet.be>.
On Oct 30, 2008, at 20:17, JWang wrote:

Hi

>
> I can make the middle table disappear if I mark margin and padding  
> to be 0pt
> of the second table :
> <fo:table-cell margin="2pt" padding="2pt" display-align="center"
> text-align="left"> or remove the table altogether. I guess that  
> partially
> answers the question...
>

Yep, for the reason, see: http://wiki.apache.org/xmlgraphics-fop/ 
IndentInheritance

(in response to your earlier post)
> Logically the two inner tables
> (units of measurement and tank) belong together in a group, that is  
> why we
> put them in one table cell. I guess the real question is under what
> circumstances FOP displays one table even though there are more  
> than one in
> the fo file.

Never. You can always only mimick that effect, but all tables that  
are present in the source will always be rendered as separate objects.

BTW: I notice that you're using "0.1mm" as border-width (/really/  
thin). If I interpret correctly, FOP 0.95 is actually doing better at  
preserving the originally specified width, which is a non-integer  
number of points in the output PDF, which may explain why it is  
necessary to turn on smoothing in Reader to get the right effect on  
the screen (pixel-rounding?)
>



HTH!

Andreas

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


Re: upgrading to 0.95 from 0.20.5, several problems

Posted by JWang <ji...@intertek.com>.
I can make the middle table disappear if I mark margin and padding to be 0pt
of the second table :
<fo:table-cell margin="2pt" padding="2pt" display-align="center"
text-align="left"> or remove the table altogether. I guess that partially
answers the question...  



JWang wrote:
> 
> Thank you very much. It does display nicely when I turn off smooth line
> art in acrobat reader. Is there a way to turn that off programmatically in
> FOP? It displays nicely in version 0.20 even I did not turn it off, which
> makes me think that can be configured in the PDF itself.  Your suggestion
> solves the problem anyway...
> 
> Regarding nested tables, I attached the source code and the result for old
> and new version here. The new version displays a middle table that makes
> the inner tables unfit for the outer table. Logically the two inner tables
> (units of measurement and tank) belong together in a group, that is why we
> put them in one table cell. I guess the real question is under what
> circumstances FOP displays one table even though there are more than one
> in the fo file.  http://www.nabble.com/file/p20253041/version_020.pdf
> version_020.pdf  http://www.nabble.com/file/p20253041/version_095.pdf
> version_095.pdf  http://www.nabble.com/file/p20253041/source.xml
> source.xml   Again, thank you for your time.
> 

-- 
View this message in context: http://www.nabble.com/upgrading-to-0.95-from-0.20.5%2C-several-problems-tp20237183p20253606.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: upgrading to 0.95 from 0.20.5, several problems

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 30.10.2008 20:50:53 JWang wrote:
> 
> Thank you very much. It does display nicely when I turn off smooth line art
> in acrobat reader. Is there a way to turn that off programmatically in FOP?

Not that I know of.

> It displays nicely in version 0.20 even I did not turn it off, which makes
> me think that can be configured in the PDF itself.  Your suggestion solves
> the problem anyway...

No, the borders are painted differently in 0.90 and later. Inner borders
are painted in two parts (each grid unit paints its own half of the
border). We don't have any additional logic that can merge table borders
for painting to avoid such effects, yet. Doing that could mean quite a
bit of work and I suspect that this is not a priority for any of the
developers at the moment.

> Regarding nested tables, I attached the source code and the result for old
> and new version here. The new version displays a middle table that makes the
> inner tables unfit for the outer table. Logically the two inner tables
> (units of measurement and tank) belong together in a group, that is why we
> put them in one table cell. I guess the real question is under what
> circumstances FOP displays one table even though there are more than one in
> the fo file.  http://www.nabble.com/file/p20253041/version_020.pdf
> version_020.pdf  http://www.nabble.com/file/p20253041/version_095.pdf
> version_095.pdf  http://www.nabble.com/file/p20253041/source.xml source.xml  
> Again, thank you for your time.

Thanks for the test case. That helps. I must say, I can't identify
anything where FOP 0.95 misbehaves. Please note that 0.95 is much more
accurate in interpreting the XSL spec than FOP 0.20.5. That in itself
can cause unwanted changes if the XSL is not fully correct. For example,
you have the "margin" shorthand on some table-cell. The margin
properties are mapped to start/end-indent and space-before/after
(chapter 5.3.2 in XSL 1.1). None of those apply to table-cell, but since
start/end-indent are inherited they have an effect on child elements.
This could have unwanted side-effects in your case. I'd simply remove
the margin shorthand and try to improve from there.

Again, I would suggest that you also replace the outer tables with
block-containers. That makes your XSL-FO simpler and easier to manage.
FOP 0.20.5 didn't support normal block-containers but FOP 0.95 does
which offers new possibilities.

HTH



Jeremias Maerki


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


Re: upgrading to 0.95 from 0.20.5, several problems

Posted by JWang <ji...@intertek.com>.
Thank you very much. It does display nicely when I turn off smooth line art
in acrobat reader. Is there a way to turn that off programmatically in FOP?
It displays nicely in version 0.20 even I did not turn it off, which makes
me think that can be configured in the PDF itself.  Your suggestion solves
the problem anyway...

Regarding nested tables, I attached the source code and the result for old
and new version here. The new version displays a middle table that makes the
inner tables unfit for the outer table. Logically the two inner tables
(units of measurement and tank) belong together in a group, that is why we
put them in one table cell. I guess the real question is under what
circumstances FOP displays one table even though there are more than one in
the fo file.  http://www.nabble.com/file/p20253041/version_020.pdf
version_020.pdf  http://www.nabble.com/file/p20253041/version_095.pdf
version_095.pdf  http://www.nabble.com/file/p20253041/source.xml source.xml  
Again, thank you for your time.
-- 
View this message in context: http://www.nabble.com/upgrading-to-0.95-from-0.20.5%2C-several-problems-tp20237183p20253041.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