Red Hat Bugzilla – Bug 450567
Printing of a page with tables results in unusably blurry output
Last modified: 2013-04-02 00:22:13 EDT
I originally wrote up a description of the end-to-end problem, (along
with a minimal test case), here:
To summarize the three necessary, (and independent) problems pointed
1. Firefox uses "fancy" compositing operators to render table borders.
This results in (small) image fallbacks in PDF output, inside
a large knockout group.
2. Poppler uses "fancy" compositing operators to render knockout groups.
This (with (1)) results in a full-page image fallback in the PostScript
output, inside a group.
3. Cairo uses the wrong resolution when rednering a PostScript image inside
This finally, (with (2) and (1)), causes the full-page blurriness.
There's another, higher-level issue (lets call it (4)) which I didn't discuss
in the original blog report. Namely, clicking "print" (on some systems) is
resulting in firefox producing a PDF file which is then converted to a
PostScript file by poppler. I have not yet analyzed an affected system to see
exactly what interaction of firefox and GtkPrint is causing this. But if
this were fixed so that GtkPrint told firefox to simply generate PostScript
output in the first place, then the bug should be eliminated.
So, there are four separate issues there, and fixing any one of them should
eliminate the end-to-end problem of blurry printing.
My first attempt was to fix issue #3. It's in cairo itself, so I'm familiar
with the code. And it's the most clearly *wrong* behavior, (where the other
issues are all perhaps less-than-ideal or non-optimal, but not wrong per se).
My attempts to fix that issue are described here:
Bug with fallback resolution of groups
It's clear that the solution there will be fairly complex, and likely
error prone. It's worth pursuing in the future. But I think we'll want
a more focused solution for the short term.
So next I turned my attention to issue #1 where I assumed we could come
up with a quick fix. Here's a bug report with initial efforts on that
Printing on linux should set SIMPLIFY_OPERATORS | DISABLE_SNAPPING
The patch there seems good and correct, (will result in the ADD operator
being replaced with OVER for example), but it's not sufficient. The border-
rendering code uses the CLEAR operator as well and SIMPLIFY_OPERATORS doesn't
change that. So all the same fallbacks are still triggered.
My next approach was a patch to replace the use of CLEAR with "draw with OVER
and with an opaque, white source" inside the border-rendering code when
under the influence of SIMPLIFY_OPERATORS. I didn't get far testing that
patch though, because I first found that in the Firefox 3 rc2 release the
entire buggy behavior seems to be gone already.
I bisected that change down and found a single-line (single-digit in fact!)
commit that changes the behavior:
I've also attached the same patch.
So I recommend this patch for a good, short-term fix for the problem.
I've verified that it fixes both my minimal test case and the printing
of a page originally reported, (not publically available).
PS. And yes, this is a lot of bug-report verbiage for a single-line
fix. But the other issues are still worth fixing, so I thought it
would be worthwhile to document what I'd done here.
Created attachment 308731 [details]
Patch from bisecting firefox 3 rc2.
Created attachment 308734 [details]
Actual patch this time (rather than HTML view of patch)
Sorry about that. I had attached the output of the webpage displaying the
patch rather than just the patch. This should be a bit more useful I think.
*** Bug 479450 has been marked as a duplicate of this bug. ***
I believe bug #479450 is a dupe of this one, but would appreciate confirmation.
While Firefox 3.1b would seem to fix the issue, I have a large number of faulty PDFs produced by firefox (the problem only became apparent when I went to print one as they look fine on-screen).
Is there anything that can be done to fix the PDFs?
(In reply to comment #0)
> To summarize the three necessary, (and independent) problems pointed
> out there:
> 3. Cairo uses the wrong resolution when rednering a PostScript image inside
> a group.
So as I understand it fixing (3) would allow the correct (non-blurry) printing of PDFs generated from Firefox under (1) (print to file, as PDF) ?
FF 3.1 seems to have fixed (1), but I still have a large number of PDFs generated by earlier versions. At the moment I don't get usable output when I print them.
I guess what I'd really like to know is whether these PDFs are effectively corrupted forever, and that I need to do some damage limitation to identify and regenerate them where I can.
(The bug is still present in F10, so could you update the bug version? I guess it might be better reassigned to cairo from firefox, too?)
I have scoured my hard drives for affected files (searching for files containing "Creator (cairo" seems to work - any reason this would miss any?).
The good news: I can re-print some of them with a newer firefox version (though I'll have to do so soon - some banks etc. only make statements available for a year, and it looks like this bug was introduced ~1 year ago)
The bad news: there are lots of others I can't re-print. I have needed, and will need, to print some of these. They're pages such as "Print a copy for your records" - I normally "print" to PDF and only really print when I need to.
From comment #0 if bugs (2) and (3) were fixed in Cairo these files would print ok - true or false?
It'd be *really* helpful to know so I can better judge when/whether it's worth trying to work around the issue.
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '9'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 9's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 9 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Please change component to Cairo and version to F11:
I've tested with Fedora 11 and while printing a print-to-PDF generated by firefox on F11 is fine, printing a print-to-PDF on F11 that was generated by firefox on F10 is still unusably blurry.
Therefore I think firefox has been fixed (1), but bugs (2) and (3) (as per comment #0) in cairo remain.
(I'd still love some wisdom on whether PDFs previously generated are recoverable)
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.