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 Juergen Birkle <Ju...@doubleSlash.de> on 2011/01/13 12:49:58 UTC

Antialising issue with borders in PDF with fop-0.95

Hi,

when generating a table in PDF with FOP and XML the borders of the table
appear in different width on the Screen (even with different PDF viewers!).

I was searching the web and this forum and found the following Question in
this forum:
http://old.nabble.com/Rows-borders-look-so-bad...-td24715165.html

In this thread "john farrow" wrote:
"What you are seeing is Acrobat anti-aliasing some parts of the border and
not others.  You can turn off anti-aliasing in Acrobat to make this go away
(on your machine), otherwise FOP needs to be fixed to remove the problem.
The problem occurs because some parts of the border are drawn using filled
shapes and some are drawn using solid lines.  Acrobat applies anti-aliasing
to one type of rendering and not the other."


This is also my issue. 

This is my table at 100% in Acrobat Reader:
http://old.nabble.com/file/p30661446/FOP_100.png FOP_100.png 

When looking at 400% at this image in gimp it is clearly visible, that the
different borders are handled with different antialiasing:
http://old.nabble.com/file/p30661446/FOP_100_400.png FOP_100_400.png 

Is there a patch available for FOP to solve this problem?
Or is it possible to disable antialiasing from within XML or Java for
borders? If that is possible, can you tell me how it is done. I couldn't
find any reference for this at the web.

>From my point of view FOP should draw all lines of a table in the same way,
not sometimes as filled shapes and sometimes as solid lines. Otherwise it is
not possible to generate high quality tables with FOP!

Best regards,
Juergen

-- 
View this message in context: http://old.nabble.com/Antialising-issue-with-borders-in-PDF-with-fop-0.95-tp30661446p30661446.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: Antialising issue with borders in PDF with fop-0.95

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Jürgen

On 14.01.2011 13:03:39 Juergen Birkle wrote:
> 
> Hallo Pete,
> 
> The print is nearly perfect, but has the same minimal difference as the
> screen.

Nearly? I haven't heard any indication, yet, that this problem appears
in print.

> The antialiasing at the screens is ALLWAYS 1px, no matter what zoom-factor
> you use at the reader. With the effect that the difference get less as you
> increase the zoom-factor.
> 
> But my main problem is, that the view of the reader looks bad in a
> zoom-range of 50% to 200%!
> 
> A line of 2px at 100% is displayed with 3 different kinds:
> 1. with antialiasing from top and bottom ==> displays as "light grey" line
> 2. with antialiasing from top or bottom ==> displays as "dark grey" line
> 3. with not antialiasing (solid) ==> displays as "black" line
> 
> If you reduce the zoom-factor to 75% or 50%, the line of 1. becomes
> invisible and 2. becomes a lighter appearance.
> 
> Print of the page is ok, but only because the printer has a much higher
> resolution.

No, because no anti-aliasing happens on a printer. The anti-aliasing is
only done on computer screens to improve the subjective resolution. And
Adobe's approach seems to have some drawbacks here.

> I have generated PDF with Excel and with it the borders are all drawn as
> solid lines. You can see the difference with Acrobat reader at 6400%. FOP
> generated files have different types of lines. The shapes are displayed with
> a thin "object-line" in the middle of the black border and antialiasing, the
> solid lines are displayed without this "object-line" and without
> antialiasing. The mixing of this two objects in one PDF file results in a
> bad display in the reader.
> 
> If there is a possibility to disable the usage of shapes (or rectangle
> object) in FOP and only use solid lines it would help me and others very
> much. Because with the mixing of this two objects in one PDF no good looking
> PDF at the screen is possible!

There is currently no switch that makes this go away. The current
approach was selected to support all different border styles in XSL-FO
and the border collapsing model. That has that precise drawback that you
see in Acrobat. Of course, it would theoretically be possible to combine
the various border segments where this is possible, for example when two
adjacent border segments have the same color. I remember back when Karen
and Keiron discussed combining border segments during the FOP redesign 
(2003/2004). Apparently, this business is quite tricky. A simple
approach might be to fall back to FOP 0.20.5's approach that simply
painted solid lines (but didn't support all border styles). But even
that sometimes looked ugly in Acrobat (or even in print).

> If you want me to show you the difference let me know, I will post the
> Screenshots at 6400% of Acrobat reader.

We know all about how it looks. This has come up several times. Disable
anti-aliasing in Acrobat and the problem goes away. Unsatisfying, I know.

Anyway, implementing a better border painting strategy with border
segment combination will be a tricky thing. I don't think you can expect
a short-term solution from anyone here, except if you give it a shot
yourself. But I doubt it is worth the effort just to improve how the
borders look in Adobe Acrobat.

<snip/>


Jeremias Maerki


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


Re: Antialising issue with borders in PDF with fop-0.95

Posted by Juergen Birkle <Ju...@doubleSlash.de>.
Hallo Pete,

The print is nearly perfect, but has the same minimal difference as the
screen.

The antialiasing at the screens is ALLWAYS 1px, no matter what zoom-factor
you use at the reader. With the effect that the difference get less as you
increase the zoom-factor.

But my main problem is, that the view of the reader looks bad in a
zoom-range of 50% to 200%!

A line of 2px at 100% is displayed with 3 different kinds:
1. with antialiasing from top and bottom ==> displays as "light grey" line
2. with antialiasing from top or bottom ==> displays as "dark grey" line
3. with not antialiasing (solid) ==> displays as "black" line

If you reduce the zoom-factor to 75% or 50%, the line of 1. becomes
invisible and 2. becomes a lighter appearance.

Print of the page is ok, but only because the printer has a much higher
resolution.

I have generated PDF with Excel and with it the borders are all drawn as
solid lines. You can see the difference with Acrobat reader at 6400%. FOP
generated files have different types of lines. The shapes are displayed with
a thin "object-line" in the middle of the black border and antialiasing, the
solid lines are displayed without this "object-line" and without
antialiasing. The mixing of this two objects in one PDF file results in a
bad display in the reader.

If there is a possibility to disable the usage of shapes (or rectangle
object) in FOP and only use solid lines it would help me and others very
much. Because with the mixing of this two objects in one PDF no good looking
PDF at the screen is possible!

If you want me to show you the difference let me know, I will post the
Screenshots at 6400% of Acrobat reader.

Thanks and best regard
Juergen





Peter Hancock-2 wrote:
> 
> Hi Juergen,
> 
> What does a print of the pdf look like?  It may be the viewer (as
> mentioned in the post you referenced) that is responsible for
> anti-aliasing the pdf for screen display, and may not be a good
> representation of the print.
> 
> Currently FOP draw each of the 4 border sections of a cell separately,
> even when they should combine to form a continuous mark - likewise for
> the neighbouring cells of a table.  Borders are represented as vector
> drawing commands in a graphical stream within the PDF
>  and the resolution of this drawing space is 1 millipoint - 1/1000th
> of 1/72th of an inch.  The drawing commands are directly generated by
> fop from the representation of the border - no intermediate Java2D ->
> rasterisation process occurs, and so antialiasing is not an inherent
> problem in the process.
> 
> I hope this helps,
> 
> Pete
> On Thu, Jan 13, 2011 at 11:49 AM, Juergen Birkle
> <Ju...@doubleslash.de> wrote:
>>
>> Hi,
>>
>> when generating a table in PDF with FOP and XML the borders of the table
>> appear in different width on the Screen (even with different PDF
>> viewers!).
>>
>> I was searching the web and this forum and found the following Question
>> in
>> this forum:
>> http://old.nabble.com/Rows-borders-look-so-bad...-td24715165.html
>>
>> In this thread "john farrow" wrote:
>> "What you are seeing is Acrobat anti-aliasing some parts of the border
>> and
>> not others.  You can turn off anti-aliasing in Acrobat to make this go
>> away
>> (on your machine), otherwise FOP needs to be fixed to remove the problem.
>> The problem occurs because some parts of the border are drawn using
>> filled
>> shapes and some are drawn using solid lines.  Acrobat applies
>> anti-aliasing
>> to one type of rendering and not the other."
>>
>>
>> This is also my issue.
>>
>> This is my table at 100% in Acrobat Reader:
>> http://old.nabble.com/file/p30661446/FOP_100.png FOP_100.png
>>
>> When looking at 400% at this image in gimp it is clearly visible, that
>> the
>> different borders are handled with different antialiasing:
>> http://old.nabble.com/file/p30661446/FOP_100_400.png FOP_100_400.png
>>
>> Is there a patch available for FOP to solve this problem?
>> Or is it possible to disable antialiasing from within XML or Java for
>> borders? If that is possible, can you tell me how it is done. I couldn't
>> find any reference for this at the web.
>>
>> From my point of view FOP should draw all lines of a table in the same
>> way,
>> not sometimes as filled shapes and sometimes as solid lines. Otherwise it
>> is
>> not possible to generate high quality tables with FOP!
>>
>> Best regards,
>> Juergen
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Antialising-issue-with-borders-in-PDF-with-fop-0.95-tp30661446p30661446.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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Antialising-issue-with-borders-in-PDF-with-fop-0.95-tp30661446p30670953.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: Antialising issue with borders in PDF with fop-0.95

Posted by Peter Hancock <pe...@gmail.com>.
Hi Juergen,

What does a print of the pdf look like?  It may be the viewer (as
mentioned in the post you referenced) that is responsible for
anti-aliasing the pdf for screen display, and may not be a good
representation of the print.

Currently FOP draw each of the 4 border sections of a cell separately,
even when they should combine to form a continuous mark - likewise for
the neighbouring cells of a table.  Borders are represented as vector
drawing commands in a graphical stream within the PDF
 and the resolution of this drawing space is 1 millipoint - 1/1000th
of 1/72th of an inch.  The drawing commands are directly generated by
fop from the representation of the border - no intermediate Java2D ->
rasterisation process occurs, and so antialiasing is not an inherent
problem in the process.

I hope this helps,

Pete
On Thu, Jan 13, 2011 at 11:49 AM, Juergen Birkle
<Ju...@doubleslash.de> wrote:
>
> Hi,
>
> when generating a table in PDF with FOP and XML the borders of the table
> appear in different width on the Screen (even with different PDF viewers!).
>
> I was searching the web and this forum and found the following Question in
> this forum:
> http://old.nabble.com/Rows-borders-look-so-bad...-td24715165.html
>
> In this thread "john farrow" wrote:
> "What you are seeing is Acrobat anti-aliasing some parts of the border and
> not others.  You can turn off anti-aliasing in Acrobat to make this go away
> (on your machine), otherwise FOP needs to be fixed to remove the problem.
> The problem occurs because some parts of the border are drawn using filled
> shapes and some are drawn using solid lines.  Acrobat applies anti-aliasing
> to one type of rendering and not the other."
>
>
> This is also my issue.
>
> This is my table at 100% in Acrobat Reader:
> http://old.nabble.com/file/p30661446/FOP_100.png FOP_100.png
>
> When looking at 400% at this image in gimp it is clearly visible, that the
> different borders are handled with different antialiasing:
> http://old.nabble.com/file/p30661446/FOP_100_400.png FOP_100_400.png
>
> Is there a patch available for FOP to solve this problem?
> Or is it possible to disable antialiasing from within XML or Java for
> borders? If that is possible, can you tell me how it is done. I couldn't
> find any reference for this at the web.
>
> From my point of view FOP should draw all lines of a table in the same way,
> not sometimes as filled shapes and sometimes as solid lines. Otherwise it is
> not possible to generate high quality tables with FOP!
>
> Best regards,
> Juergen
>
> --
> View this message in context: http://old.nabble.com/Antialising-issue-with-borders-in-PDF-with-fop-0.95-tp30661446p30661446.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