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 reevev <re...@xplosiventerprises.com> on 2012/11/02 13:29:46 UTC

Re: Cell border rendering error (thicker) with number-column-spanned

Hi,

This does appear to be a fop bug and not a rendering issue.  We have
templates that render correctly with fop 0.20.5, however in fop 1.0 we are
seeing this exact issue with the middle section of the spanned columns
showing a thicker border.

Has anyone found a solution to this issue?

Note the issue is still present when zooming in to 800%.

Thanks,

Reeve.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37226.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: Cell border rendering error (thicker) with number-column-spanned

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Reeve,
the reason for the change was to support line styles other than "solid",
"dashed" and "dotted" and the collapsing border model on tables. 0.20.5
painted simple lines, resulting in rectangles that effectively
overlapped (potentially producing ugly side-effects themselves). During
the redesign this was changed to using clip paths to cut the lines to
the exact shape that we need. Notes at [1] show why the current model
was chosen. Over time, it has come up a number of times (this isn't the
first time) that anti-aliassing features in various PDF viewers cause
suboptimal results (on screen only, NEVER in print because there is no
anti-aliassing there) with FOP's current approach.

To fix the problem and still preserve the current feature-richness,
there will need to be improvements on the way borders are painted, but
they will not be easy to implement:

The painting of the border grid of a table has to be changed to
group the painting of border segments together. The IFRenderer would
have to be extended with an optimizer of some sorts that can try (!) to
combine the various grid segments to larger combined structures, ex.
longer lines of the same color. That may even have an influence on the
structure of the area tree. There's also a relationship to the z-index
feature (grouping, buffering and ordering of painting operations).
Different line thicknesses may effectively get in the way of that
optimization.

Ideally, a table with a simple black grid would be painted with just the
minimal set of lines (without clip paths). That would basically
guarantee no side-effects. But that is only possible for the simple
cases. More complex cases require the "tricks" we use here to paint the
border segments and that may easily lead to the unwanted visual
artifacts we're seeing today. So, I don't think there is a silver bullet.
There's room for optimization but not without an influence on the code
complexity. And all that just because some PDF viewers produce different
results for two lines with the same thickness. OTOH, it has the
potential to produce slightly smaller output files.

Anti-aliassing's a bitch that's great for text but only produces issues
with vector graphics.

I do remember extensive discussions on border painting during 2003/2004
that effectively showed the complexity of getting border painting "right".

[1] http://wiki.apache.org/xmlgraphics-fop/CollapsingBorderModel

Jeremias Maerki


On 04.11.2012 05:16:10 reevev wrote:
> Hi,
> 
> Thanks for providing the sample.  I agree that this illustrates that the
> various PDF viewers are not doing the right thing with the line thickness
> and I'm not disagreeing with this point.  However the fact remains that fop
> 0.20.5 output the borders in a method that the PDF viewers displayed
> correctly and newer versions of fop don't produce the desired output.
> 
> By changing to fop 1.0 (or 1.1) we now are seeing output that isn't rendered
> correctly in the industry standard PDF viewer, as well as other common PDF
> viewers, and this is why I say the bug is with FOP.  It may be technically
> correct output, but if it isn't displayed correctly anywhere it is besides
> the point.
> 
> Is there somewhere I can find out more on why the border rendering was
> changed?  I'm guessing there was a reason it was changed.  If I wanted to
> change the source so it rendered the old way it would probably create
> different issues that I'm not aware of.
> 
> Thanks,
> 
> Reeve.
> 
> 
> 
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37244.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: Cell border rendering error (thicker) with number-column-spanned

Posted by reevev <re...@xplosiventerprises.com>.
Hi,

Thanks for providing the sample.  I agree that this illustrates that the
various PDF viewers are not doing the right thing with the line thickness
and I'm not disagreeing with this point.  However the fact remains that fop
0.20.5 output the borders in a method that the PDF viewers displayed
correctly and newer versions of fop don't produce the desired output.

By changing to fop 1.0 (or 1.1) we now are seeing output that isn't rendered
correctly in the industry standard PDF viewer, as well as other common PDF
viewers, and this is why I say the bug is with FOP.  It may be technically
correct output, but if it isn't displayed correctly anywhere it is besides
the point.

Is there somewhere I can find out more on why the border rendering was
changed?  I'm guessing there was a reason it was changed.  If I wanted to
change the source so it rendered the old way it would probably create
different issues that I'm not aware of.

Thanks,

Reeve.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37244.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: Cell border rendering error (thicker) with number-column-spanned

Posted by Luis Bernardo <lm...@gmail.com>.
Attached is a hand crafted PDF that shows the issue. It was not created 
with FOP.

You can open the PDF with notepad or similar and check the drawing 
commands to confirm that the thickness of the segments is the same.

On 11/3/12 11:37 PM, reevev wrote:
> Hi,
>
> The problem exists with other PDF viewers as well. I've tried foxit reader
> and it has the same issues.
>
> We are looking at re-writing templates not to use spanned columns where
> possible, and for other cases where this is not possible we will have to
> fall back to fop 0.20.5 which works as expected.
>
> This is  definitely a fop isuse and not an Adobe Reader issue.  The fact
> that we have a template transformed to pdf in fop 0.20.5 which renders
> correctly in both Adobe Reader and Foxit Reader, yet when transformed with
> fop 1.0 it renders incorrectly in both Adobe Reader and Foxit Reader points
> to a fop issue.  The only part of the equation that has changed is replacing
> fop 0.20.5 with fop 1.0.
>
> We'll just treat it as a bug and if we get time to look into the source
> ourselves we will do so, otherwise will have to be mindful of the issue
> going forward.
>
> Thanks,
>
> Reeve.
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37241.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: Cell border rendering error (thicker) with number-column-spanned

Posted by reevev <re...@xplosiventerprises.com>.
Hi,

The problem exists with other PDF viewers as well. I've tried foxit reader
and it has the same issues.

We are looking at re-writing templates not to use spanned columns where
possible, and for other cases where this is not possible we will have to
fall back to fop 0.20.5 which works as expected.

This is  definitely a fop isuse and not an Adobe Reader issue.  The fact
that we have a template transformed to pdf in fop 0.20.5 which renders
correctly in both Adobe Reader and Foxit Reader, yet when transformed with
fop 1.0 it renders incorrectly in both Adobe Reader and Foxit Reader points
to a fop issue.  The only part of the equation that has changed is replacing
fop 0.20.5 with fop 1.0.

We'll just treat it as a bug and if we get time to look into the source
ourselves we will do so, otherwise will have to be mindful of the issue
going forward.

Thanks,

Reeve.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37241.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: Cell border rendering error (thicker) with number-column-spanned

Posted by Luis Bernardo <lm...@gmail.com>.
First, I understand why this issue is annoying. When I open the document 
Adobe defaults in my monitor to a 170% zoom and the problem is clearly 
visible. Incidentally the problem is not visible at 100%.

But I looked at the document and can guarantee that the problem is with 
Adobe Reader. The thickness of the segments are always the same. In FOP 
0.20.5 the cell that spans three columns is drawn with 4 segments. In 
FOP 1.0 the cell is drawn with 8 segments. Maybe due to some rounding 
error Adobe is drawing the middle segments at a different thickness for 
some magnification values, but in the PDF the thickness is always the same.

I suggest you change your table layout. Maybe by nesting tables you can 
achieve the same visual output without needing to use spanning across 
columns...

On 11/2/12 1:55 PM, reevev wrote:
> Hi,
>
> Thanks for your reply.  While I can confirm that disabling "Enhance thin
> lines" corrects the display it doesn't solve the issue that the same
> templates rendered correctly even with this option enabled when we use
> 0.20.5 to generate the pdf.
>
> Our issue is that "Enhance thin lines" is turned on by default and for most
> users they will end up seeing a poor looking PDF now that we've started
> using Fop 1.0, vs. a correct looking PDF prior to the upgrade, so from the
> end user's perspective this is broken.  Is there any way we can have the
> same sort of rendering used in 0.20.5 for table borders?
>
> Thanks,
>
> Reeve.
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37229.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
>


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


Re: Cell border rendering error (thicker) with number-column-spanned

Posted by Chris Bowditch <bo...@hotmail.com>.
On 02/11/2012 13:55, reevev wrote:
> Hi,

Hi Reeve,

>
> Thanks for your reply.  While I can confirm that disabling "Enhance thin
> lines" corrects the display it doesn't solve the issue that the same
> templates rendered correctly even with this option enabled when we use
> 0.20.5 to generate the pdf.
>
> Our issue is that "Enhance thin lines" is turned on by default and for most
> users they will end up seeing a poor looking PDF now that we've started
> using Fop 1.0, vs. a correct looking PDF prior to the upgrade, so from the
> end user's perspective this is broken.  Is there any way we can have the
> same sort of rendering used in 0.20.5 for table borders?

No such option exists today. However, FOP is an open source project, so 
patches are welcome :)

However, please be warned that the table border drawing code is very 
complicated so altered the way borders are drawn to work around Acrobat 
bugs will not be trivial.

Thanks,

Chris

>
> Thanks,
>
> Reeve.
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37229.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
>
>
>


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


Re: Cell border rendering error (thicker) with number-column-spanned

Posted by reevev <re...@xplosiventerprises.com>.
Hi,

Thanks for your reply.  While I can confirm that disabling "Enhance thin
lines" corrects the display it doesn't solve the issue that the same
templates rendered correctly even with this option enabled when we use
0.20.5 to generate the pdf.

Our issue is that "Enhance thin lines" is turned on by default and for most
users they will end up seeing a poor looking PDF now that we've started
using Fop 1.0, vs. a correct looking PDF prior to the upgrade, so from the
end user's perspective this is broken.  Is there any way we can have the
same sort of rendering used in 0.20.5 for table borders?

Thanks,

Reeve.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-tp17999p37229.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: Cell border rendering error (thicker) with number-column-spanned

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,
border drawing design is quite different in FOP current Vs FOP 0.2x.
The former was quite imprecise, and could not easily support extended
border features.

I've tried your test case (from archive [1]) against Acrobat Reader X,
and at normal zoom the display depends on "Enhance Thin Lines" option;
if checked, there is no issue.

When zooming, the issue disappears. So this appears to be related on
how the viewer shows little objects

[1] http://apache-fop.1065347.n5.nabble.com/Cell-border-rendering-error-thicker-with-number-column-spanned-td17999.html#a37226

2012/11/2 reevev <re...@xplosiventerprises.com>:
> Hi,
>
> This does appear to be a fop bug and not a rendering issue.  We have
> templates that render correctly with fop 0.20.5, however in fop 1.0 we are
> seeing this exact issue with the middle section of the spanned columns
> showing a thicker border.
> Has anyone found a solution to this issue?
> Note the issue is still present when zooming in to 800%.


-- 
pascal

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