Thunderbird cannot print to PDF

Bug #332472 reported by Niclas Lockner
10
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Fix Released
Wishlist
mozilla-thunderbird (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: mozilla-thunderbird

Thunderbird cannot print a mail to PDF since it uses its own UI for printing. Print to file only prints a postscript file.
Why doesn't thunderbird use the global printing UI where you can choose PDF?

Revision history for this message
Niclas Lockner (niclasl) wrote :

Binary package hint: mozilla-thunderbird

Thunderbird cannot print a mail to PDF since it uses its own UI for printing. Print to file only prints a postscript file.
Why doesn't thunderbird use the global printing UI where you can choose PDF?

Revision history for this message
Niclas Lockner (niclasl) wrote :

ubuntu 9.04

thunderbird:
  Installed: 2.0.0.19+nobinonly-0ubuntu1

Revision history for this message
Ciarán Mooney (ciaran-mooney) wrote :

Hi,

Thanks for reporting this. It seems to be because Thunderbird is not integrated with the rest of the desktop. It hasn't had as much polish as Firefox.

The lack of PDF has already been noted on Mozilla's Bugzilla list

https://bugzilla.mozilla.org/show_bug.cgi?id=462872

Hopefully they will try and integrate this.

Ciaran

Changed in thunderbird:
status: Unknown → New
Changed in mozilla-thunderbird:
status: New → Confirmed
Revision history for this message
wollombi (wollombi) wrote :

I am also seeing this problem in Thunderbird. Strangely enough, Firefox uses the global printing UI.

Ubuntu 9.04
Thunderbird: 2.0.0.21+nobinonly-0ubuntu1.9.04.1 (jaunty)

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

When Firefox first started using cairo for printing it was using PDF format. Bug 415425 changed the format to PS because transparent images were printed as black.

The other issue is that gtk_printer_accepts_pdf() always returns TRUE regardless of whether the PDF format is supported. I've added a note about this to https://bugzilla.gnome.org/show_bug.cgi?id=560177#c6

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

> The lack of PDF has already been noted on Mozilla's Bugzilla list
> https://bugzilla.mozilla.org/show_bug.cgi?id=462872

That is a different bug. Mozilla bug 462872 is requesting that that Firefox use PDF as the CUPS print job format.

What you want is for Thunderbird to use the gtk print dialog like Firefox 3. This has been fixed in Thunderbird 3.

Revision history for this message
oss_test_launchpad (oss-test-launchpad) wrote :

This bug still exists in Thunderbird Version 2.0.0.23 (20090817) that ships with Ubuntu 10.04 Alpha 2.

Revision history for this message
Przemek K. (azrael) wrote :

Lucid ships Thunderbird 3.0 now.

Package thunderbird

    * lucid (mail): mail/news client with RSS and integrated spam filter support
      3.0.4+nobinonly-0ubuntu3: amd64 i386

Revision history for this message
In , Till Kamppeter (till-kamppeter) wrote :

The problems of black backgrounds in images in PDF files are solved now, after various bug fixes in Ghostscript and Poppler, so PDF can now safely be used as printing output.

Changed in thunderbird:
importance: Unknown → Wishlist
Revision history for this message
In , Till Kamppeter (till-kamppeter) wrote :

All the mentioned problems are solved, so we should be able to safely switch to PDF output now.

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

Created attachment 501949
print as pdf where possible

Attached is a patch to make printing use PDF if supported by the printer.

gtk_printer_accepts_pdf() has been fixed in gtk+ 2.24 so this function can be used to check if the printer supports PDF.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Note: This bug and the referenced upstream bug are different bugs. This bug is about the missing facility of exporting e-mails into PDF files on the local file system. The print dialog of Thunderbird 2.x and older is not the standard print dialog of GNOME and its "Print to File" generates only PostScript files. There is also no "Export to PDF" in the "File" menu. The referenced upstream bug is about the data format which is sent if one prints to an actual print queue. This format should be PDF and not PostScript any more.

This bug is actually fixed in Thunderbird 3.x, as 3.x uses the standard GNOME printing dialog and so the "Print to File" functionality allows exporting PDF files. The referenced upstream bug is not yet fixed, but a patch is supplied there.

Changed in mozilla-thunderbird (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
In , Ilja Sekler (ilja-sekler-) wrote :

(In reply to comment #4)

> gtk_printer_accepts_pdf() has been fixed in gtk+ 2.24 so this function can be
> used to check if the printer supports PDF.

On Ubuntu 10.10, Firefox with this patch (and <https://bugzilla.mozilla.org/attachment.cgi?id=502460>, of course) applied still passes PS instead of PDF to CUPS, so probably either CUPS or gtk2 on Ubuntu lies. Would it be better to offer a preference to override detection and enforce PDF?

I get perfect prints of <http://weblogs.mozillazine.org/asa/archives/2010/12/new_firefox_4_betas.html> out of my HP inkjet printer only with a dirty private hack when I swap kOutputFormatPS and kOutputFormatPDF in

format = (gtk_printer_accepts_ps(mGtkPrinter)) ? nsIPrintSettings::kOutputFormatPS
                                               : nsIPrintSettings::kOutputFormatPDF;

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

(In reply to comment #5)
> On Ubuntu 10.10, Firefox with this patch (and
> <https://bugzilla.mozilla.org/attachment.cgi?id=502460>, of course) applied
> still passes PS instead of PDF to CUPS, so probably either CUPS or gtk2 on
> Ubuntu lies.

That's because the patch contains a gtk version check. gtk versions older than 2.24 lie about the PDF print capability so we fallback to PS in that case. This is probably a good thing as it ensures that if the gtk is new enough to correctly report the PDF print capability, the distro will also have recent versions of poppler and ghostscript that have fixed the PDF printing bugs.

> Would it be better to offer a preference to override detection and
> enforce PDF?

Probably not. There is no immediate benefit to using PDF. This is more about providing longer term benefits such as:

- Avoiding rasterization of transparency on printers that can print PDF directly

- Avoid unnecessary conversion of PS to PDF then back to PS in cups

- As PDF is replacing PS as the standard printer language, most of my cairo PS/PDF work will be focused on improving and optimizing the cairo PDF output. The PS surface will only get bug fixes.

Revision history for this message
In , Ilja Sekler (ilja-sekler-) wrote :

(In reply to comment #6)
> (In reply to comment #5)
>> On Ubuntu 10.10, Firefox with this patch [...] applied still
>> passes PS instead of PDF to CUPS, so probably either CUPS or
>> gtk2 on Ubuntu lies.
>
> That's because the patch contains a gtk version check. gtk versions
> older than 2.24 lie about the PDF print capability so we fallback
> to PS in that case.

Sorry, I simply mixed up gtk2 and gnome versions :-(
Of course, the check for gtk_minor_version fails on Ubuntu 10.10.

>> Would it be better to offer a preference to override detection and
>> enforce PDF?
>
> Probably not. There is no immediate benefit to using PDF.

I have to disagree. The benefit is major and immediate. Gecko PS output has severe issues at the moment when dealing with transparency. The visual impression of printing semi-transparent elements is the following: they get rendered to the screen resolution first (text is hinted to the screen resolution), then the bitmap is scaled up to 300dpi resolution and so dumped into PS. This looks very bad. But even usual 300dpi image fallbacks are perceptibly blurry when printed on a 600dpi inkjet printer.

The similar issue in respect to PDF output <https://bugzilla.mozilla.org/show_bug.cgi?id=624152> has a patch waiting for checkin, with this patch as well as prior to the regression passing Gecko PDF output directly to CUPS worked and works perfectly.

This is why it would be so nice to have a user_pref to allow testers and ordinary users to easily workaround Gecko, Cairo, Ghostscript, gtk2 and CUPS limitations and bugs without a need to build their own hacked versions.

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

(In reply to comment #7)
> I have to disagree. The benefit is major and immediate. Gecko PS output has
> severe issues at the moment when dealing with transparency. The visual
> impression of printing semi-transparent elements is the following: they get
> rendered to the screen resolution first (text is hinted to the screen
> resolution), then the bitmap is scaled up to 300dpi resolution and so dumped
> into PS. This looks very bad. But even usual 300dpi image fallbacks are
> perceptibly blurry when printed on a 600dpi inkjet printer.

If this is only occurring with PS you may be seeing this bug:

https://bugs.freedesktop.org/show_bug.cgi?id=24692

Can you try testing with cairo master to see if it has been fixed?

Revision history for this message
In , Ilja Sekler (ilja-sekler-) wrote :

(In reply to comment #8)

> If this is only occurring with PS you may be seeing this bug:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=24692
>
> Can you try testing with cairo master to see if it has been fixed?

Yes, thank you, this is exactly the bug I saw and I can confirm that this is fixed for PostScript in git master.

Mozilla/5.0 (X11; Linux i686; rv:2.0b10pre) Gecko/20110114 Firefox/4.0b10pre built from <http://hg.mozilla.org/mozilla-central/rev/67846d45d7cf> with --enable-system-cairo and required patches (cairo from <http://cgit.freedesktop.org/cairo/commit/?id=14afb69d3dc889715451cab6f54ec6ce73b431dd>).

Revision history for this message
In , Karlt (karlt) wrote :
Revision history for this message
In , Karlt (karlt) wrote :

Comment on attachment 501949
print as pdf where possible

Thanks.
r+ with the unnecessary brackets around gtk_printer_accepts_pdf(mGtkPrinter) removed.

Changed in thunderbird:
status: New → Confirmed
Revision history for this message
In , Karlt (karlt) wrote :
Changed in thunderbird:
status: Confirmed → Fix Released
Revision history for this message
louiswilliam.techie (louiswilliam-techie) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.