After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 585442 - Evince should output PDF instead of PostScript when printing
Evince should output PDF instead of PostScript when printing
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: printing
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on: 599401
Blocks:
 
 
Reported: 2009-06-11 15:41 UTC by Till Kamppeter
Modified: 2018-05-22 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make evince output pdf on supported printers (739 bytes, patch)
2009-06-23 21:10 UTC, Johan Brannlund
rejected Details | Review

Description Till Kamppeter 2009-06-11 15:41:41 UTC
Please describe the problem:
See

http://bugzilla.gnome.org/show_bug.cgi?id=560177

We are changing the printing workflow from PostScript-centric to PDF-centric. PDF has more compact files, allows reliable page management (separate and rearrange pages), color management, transparency, ... So printing gets much improved by not pushing the print jobs through the PostScript bottleneck.

Unfortunately, the fix of the above-mentioned bug report/feature request does not affect evince. evince needs to be modified by itself. But the modification to do is simple. It is only a 2-line-change patch. See

https://bugs.launchpad.net/bugs/258421

for the patch.

Perhaps one should put the change into a conditional and allow a switch between PostScript or PDF printing by the ./configure script.

Steps to reproduce:
Set "LogLevel=debug" in /etc/cups/cupsd.conf and restart CUPS (or run "cupsctl LogLevel=debug"). Then print a file from evince. Look into /var/log/cups/error_log for the logging of this print job. CUPS tells that it has received PostScript. What we want to have is that CUPS receives the job in PDF format.

Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Christian Persch 2009-06-11 23:35:18 UTC
That "patch" on launchpad is a joke, right? Commenting out some code? (And the same for the gtk+ "patch".) And it's probably breaking printing to file in the user-selected format.

At a minimum, the code must check gtk_printer_accepts_pdf() on the selected printer. 
Comment 2 Till Kamppeter 2009-06-12 06:41:01 UTC
Sorry for referencing to this bad patch. This report is more to ask for switching the print output to PDF in evince, not to present a particular solution on how to do so.

I tested the patch now and found out that in fact it breaks the printing into a PostScript file.

A check whether the printer accepts PDF is not needed as one of the features of CUPS is that it does all hardware-specific and applications can send the jobs in a hardware-independent format. CUPS does all conversions needed. Qt sends for example PDF on all systems which use CUPS 1.2 or newer.
Comment 3 Christian Persch 2009-06-12 13:05:11 UTC
(In reply to comment #2)
> A check whether the printer accepts PDF is not needed as one of the features of
> CUPS is that it does all hardware-specific and applications can send the jobs
> in a hardware-independent format. CUPS does all conversions needed. Qt sends
> for example PDF on all systems which use CUPS 1.2 or newer.

But CUPS is not the only gtk printing backend. So a check is definitly needed; it's just that with CUPS it will always be TRUE.
Comment 4 Till Kamppeter 2009-06-19 22:46:20 UTC
A better approach of a patch was added to the ubuntu bug report. It checks the PDF capability (I hope the function assumes PDF capability if the printer is a CUPS queue) of the print queue and it also respects the user-selected format for printing to a file.
Comment 5 Till Kamppeter 2009-06-23 07:39:51 UTC
I have tested the last patch attached by Johan Brannlund to the Ubuntu bug report on 06/20 and it works perfectly for me. When printing to a file I get the requested format and when printing to a CUPS queue I get PDF.
Comment 6 Johan Brannlund 2009-06-23 21:09:22 UTC
Attaching the above-mentioned patch here for reference.
Comment 7 Johan Brannlund 2009-06-23 21:10:45 UTC
Created attachment 137275 [details] [review]
Make evince output pdf on supported printers
Comment 8 Carlos Garcia Campos 2009-06-25 12:42:16 UTC
Fixed in git master. Thanks!
Comment 9 Christian Persch 2009-10-25 19:08:58 UTC
Re-opening since the patch was reverted in 0ea65770661ff5769d7539afb77dd634a78e9fd4 (master) and fd77f2e6058da799bbe0c705e710402f8644f9d2 (gnome-2-28), with reference to https://bugs.launchpad.net/ubuntu/+source/evince/+bug/451265 .
Comment 10 Adrian Johnson 2009-10-25 22:45:36 UTC
The ubuntu bug referenced in the revert is incorrect. It should be

https://bugs.edge.launchpad.net/ubuntu/+source/cups/+bug/443026

There are two bugs that need to be fixed before PDF output can be restored without introducing regressions:

https://bugzilla.gnome.org/show_bug.cgi?id=599401

http://bugs.ghostscript.com/show_bug.cgi?id=690823
Comment 11 Germán Poo-Caamaño 2012-09-14 22:23:54 UTC
The bug http://bugs.ghostscript.com/show_bug.cgi?id=690823 was fixed 2011.
According to the comments, there should not be regressions now.
Comment 12 Germán Poo-Caamaño 2012-09-14 22:24:44 UTC
(In reply to comment #11)
> The bug http://bugs.ghostscript.com/show_bug.cgi?id=690823 was fixed 2011.
> According to the comments, there should not be regressions now.

I forgot to mention, the fix is in http://bugs.ghostscript.com/show_bug.cgi?id=689150
Comment 13 Till Kamppeter 2012-12-13 23:56:35 UTC
Can the fix for this bug get applied now? All bugs blocking this one are fixed now.
Comment 14 James Cloos 2012-12-14 13:12:03 UTC
BTW, Evince should not alter PostScript or PDF files when printing them; it must submit the files as-is to cups.

Anything else guarantees damaged output.

(There is no such thing as bijective conversion between the two int he floss world.  No floss-ware exists which can take an arbitrary ps document and output a pdf which will print the same, nor do any exist which can take an arbitrary pdf and convert it to identical ps.  Simple files may convert OK, but the important ones will not.  And if such a conversion is required due to limitations of the printer, that is cups' job, not evince's.  The prints shouldn't look different just because they were printed from evince rather than from lp(1) or lpr(1) or any other app.)

For DVI files and the commics files evince supports, it should ask cups what the print queue prefers and generate that.  (If the queue is to a postscript printer which cannot also handle pdf, it is better to generate ps; if the queue is handled by ghostscript it is better to generate pdf, etc.)
Comment 15 GNOME Infrastructure Team 2018-05-22 13:34:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/92.