Bug 24438 - Table cells with background-color attribute specified may damage borders for rounding table cells.
Summary: Table cells with background-color attribute specified may damage borders for ...
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.20.5
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 29759 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-05 17:51 UTC by Sergei Namchaninov
Modified: 2012-04-01 06:57 UTC (History)
1 user (show)



Attachments
This is patch for FOP 0.20.5 to solve problem with borders inside table cells with background color specified. For PDF only. (13.47 KB, application/octet-stream)
2003-11-05 17:52 UTC, Sergei Namchaninov
Details
Namchaninov's patch in regular diff format (6.89 KB, patch)
2004-06-23 14:49 UTC, Anton Tagunov
Details | Diff
Simple test case (3.18 KB, text/plain)
2004-06-23 14:50 UTC, Anton Tagunov
Details
800% fragment view in Acrobat Reader of pdf generated by 20.5 (238.35 KB, image/bmp)
2004-06-23 14:53 UTC, Anton Tagunov
Details
800% fragment view in Acrobat Reader generated with 20.5 patched by Namchaninov (231.24 KB, image/bmp)
2004-06-23 14:54 UTC, Anton Tagunov
Details
Horrible results of Namchinov's patch (710 bytes, image/bmp)
2004-09-02 18:44 UTC, tagunov
Details
Fix table cells with background not rendered okay for PDF, SVG and AWT renderers. (52.88 KB, patch)
2004-09-09 13:48 UTC, Anton Tagunov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Namchaninov 2003-11-05 17:51:04 UTC
Problem: Table cells with background-color attribute specified may damage 
borders for rounding table cells.
Solution: Borders now added over all other cell content.
Limitation: PDF only.

Technical background: All data concerning table cell borders and background 
SVG graphics now collecting during usual table generation. At this time there 
are no borders generated. If table generated successfully the all borders 
being collected at the time of table content generation will made over (in 
separate pass).
Comment 1 Sergei Namchaninov 2003-11-05 17:52:30 UTC
Created attachment 8947 [details]
This is patch for FOP 0.20.5 to solve problem with borders inside table cells with background color specified. For PDF only.
Comment 2 Glen Mazza 2003-11-05 22:42:03 UTC
Please submit an actual CVS-generated patch as defined here:

http://cocoon.apache.org/2.1/howto/howto-patch.html

Full source code is not helpful for us, as we can't see the changes made.  Note 
we are not making many changes to our 0.20.5 maintenance branch--especially 
those involving significant functionality changes.  So it may take awhile 
before we get to it, or we may just be interested in ensuring the problem does 
not occur in our future 1.0 version.

It would be also helpful for you to attach an extremely simple FO that shows 
the problem, as well as the output PDF from that FO.

Thanks,
Glen
Comment 3 Chris Bowditch 2004-06-23 13:30:03 UTC
*** Bug 29759 has been marked as a duplicate of this bug. ***
Comment 4 Anton Tagunov 2004-06-23 14:49:08 UTC
Created attachment 11925 [details]
Namchaninov's patch in regular diff format
Comment 5 Anton Tagunov 2004-06-23 14:50:01 UTC
Created attachment 11926 [details]
Simple test case
Comment 6 Anton Tagunov 2004-06-23 14:53:22 UTC
Created attachment 11927 [details]
800% fragment view in Acrobat Reader of pdf generated by 20.5
Comment 7 Anton Tagunov 2004-06-23 14:54:18 UTC
Created attachment 11929 [details]
800% fragment view in Acrobat Reader generated with 20.5 patched by Namchaninov
Comment 8 Anton Tagunov 2004-06-23 14:56:03 UTC
I can confirm that bug really manifests itself in 20.5
I can confirm that patched fop generates a better pdf for my sample FO
Comment 9 Martin Schulze 2004-07-21 09:04:48 UTC
This Problem is actually two Problems:

1. Borders have to be rendered after backgrounds. Namchaninov's Patch takes care
of that.

2. Cell backgrounds are being rendered (0.5pt in every direction) larger than
they should, bleeding into and overlapping borders of other cells.
This happens because the background is at long last rendered in PDF as a filled
rectangle WITH a border in the same color - which I guess to be 1pt wide.

Bad function in PrintRenderer:
protected void addFilledRect(int x, int y, int w, int h, PDFPathPaint fill) {
   addRect(x, y, w, h, fill, fill);
}

My quick'n extraordinary dirty fix is to change the addRect-function in
PDFRenderer like this:

  if (stroke== fill) addFilledRect(x, y, w, h, fill);
  else { blah..blah..

Hope this helps someone
Comment 10 tagunov 2004-09-02 18:43:34 UTC
I hereby confess that I've been wrong about Namchinov's patch.
It produces horrible results, see sample bellow.
This patch shouldn't be applied by anyone.
Comment 11 tagunov 2004-09-02 18:44:18 UTC
Created attachment 12618 [details]
Horrible results of Namchinov's patch
Comment 12 Anton Tagunov 2004-09-09 13:45:45 UTC
Okay, now I've got my own variant of remedy. My own patch.
IMO the problem is that rectangles that should methematically be areas

    startx < x < startx + w
    starty < y < starty + w

are painted as rectangles with borders. This makes them wider and taller then they should be. They start to paint over borders that do not belong to them.

I have (hopefully) fixed this for PDF, SVG and AWT renderers. My patch also deletes some unused methods and IMO makes the code a bit cleaner.

IMO 0.20.6 should be. It should take as a mantra: we won't struggle to introduce new features. It shouldn't try to fix difficult to fix bugs. It should go for low-hanging fruit. Little code change that will improve user experience. I modestlty consider that this patch should be part of it.
Comment 13 Anton Tagunov 2004-09-09 13:48:50 UTC
Created attachment 12680 [details]
Fix table cells with background not rendered okay for PDF, SVG and AWT renderers.
Comment 14 Chris Bowditch 2004-09-10 09:59:35 UTC
The issue of borders being painted as rectangles instead of lines has been 
fixed for PDF in CVS HEAD code. The 0.20.x code is frozen and patches against 
are unlikely to be applied.
Comment 15 Pascal Sancho 2007-11-20 00:50:30 UTC
Fixed in FOP 0.94 and probably since 2004-09-10 (see Chris comment)
Comment 16 Glenn Adams 2012-04-01 06:57:42 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed