Bug 286825 - Okular should generate PDFs when printing instead of GhostScript
Summary: Okular should generate PDFs when printing instead of GhostScript
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.5.81
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 309385 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-17 07:58 UTC by karaluh
Modified: 2020-07-12 22:58 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description karaluh 2011-11-17 07:58:31 UTC
Version:           0.5.81
OS:                Linux

This is according to
https://bugs.launchpad.net/ubuntu/+source/okular/+bug/891199

Reproducible: Didn't try

Steps to Reproduce:
It is stupid i have to fill this textbox all the time


Expected Results:  
It is stupid i have to fill this textbox all the time

OS: Linux (i686) release 3.0.0-13-generic
Compiler: gcc
Comment 1 Albert Astals Cid 2011-11-20 19:42:25 UTC
Expecting me to go to the ubuntu bugtracker and loose my time because you did not want to loose your time is selfish and bad mannered.
Comment 2 Ismail Donmez 2011-11-20 19:49:17 UTC
Don't know if its valid or not but here is the upstream bug report:

The standard format for print jobs has changed from PostScript to PDF:

http://www.openprinting.org/
http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdf_as_standard_print_job_format

Most applications are switched over from sending PostScript to sending PDF and CUPS in Debian and Ubuntu turns every incoming job to PDF, does page management operations (N-up, selected pages, ...) on a PDF data stream and then rasterizes the PDF data directly into the printer's native language.

While investigating bug 891074 I have found out that Okular is one of the few programs which still sends PostScript. To make the CUPS workflow more straight and to fulfill the new standard it should send PDF (and AFAIK the other KDE programs send PDF). In addition, the most displayed file format is PDF and Okular could simply pass through the PDF input files when printing, making the printing even faster and more reliable.
Comment 3 Albert Astals Cid 2011-11-20 21:44:00 UTC
I don't see why this is a bug, moving to wish. Postscript printing should still be supported by Ubuntu, and if it is not, it is their problem they decided to move away from the default printing system without caring for people using the printing system itself.
Comment 4 karaluh 2011-11-21 08:35:11 UTC
(In reply to comment #1)
> Expecting me to go to the ubuntu bugtracker and loose my time because you did
> not want to loose your time is selfish and bad mannered.

Writing this comment took you more time than following the link I provided. I report bugs to help make KDE better, not to be insulted by arrogant devs. For the record, pasting takes the same amount of time regardless of the size of text pasted, which makes your assumptions about my manners invalid. This is the last Okular bug I ever reported.
Comment 5 Albert Astals Cid 2011-11-21 08:46:22 UTC
(In reply to comment #4)
> Writing this comment took you more time than following the link I provided. 
It did to me, but do you think I am the only person reading KDE bugs? 
There is lots of people trying to read, triage and fix KDE bugs, the fact that you make each and every of them go to ubuntu bug tracker to read something that could be easily be put into this bug report is making lots of people lose lots of time. That is bad for all of us, included you, since it lowers the possibility of your bug ever getting fixed.

> I  report bugs to help make KDE better, not to be insulted by arrogant devs. For
> the record, pasting takes the same amount of time regardless of the size of
> text pasted, which makes your assumptions about my manners invalid. 
So you did not make it to save your time, why did you paste the text then?

> This is the last Okular bug I ever reported.
This means your bugs might go unfixed since there might  be no report about it. You are only harming yourself with this stance
Comment 6 karaluh 2011-11-21 10:19:44 UTC
(In reply to comment #5)
> There is lots of people trying to read, triage and fix KDE bugs, the fact that
> you make each and every of them go to ubuntu bug tracker to read something 
> that could be easily be put into this bug report is making lots of people 
> lose lots of time. That is bad for all of us, included you, since it lowers
> the possibility of your bug ever getting fixed.

Valid point.

> So you did not make it to save your time, why did you paste the text then?

I didn't see the reason to do that. Now back to the bug:

(In reply to comment #3)
> I don't see why this is a bug, moving to wish.

Not following official standard IMHO is a bug.

> Postscript printing should still
> be supported by Ubuntu,

It is.

> and if it is not, it is their problem they decided to
> move away from the default printing

The new default is to sent jobs to CUPS as PDFs.
Comment 7 Albert Astals Cid 2011-11-21 22:47:29 UTC
(In reply to comment #6)
> > I don't see why this is a bug, moving to wish.
> 
> Not following official standard IMHO is a bug.

It's not a bug because:
 a) "Printing to PDF as default" won't be the default until CUPS 1.6 that is still not shipped in any distro, just that Ubuntu decided to go on their way and enable it already
 b) We need to support other printing systems other than cups
 c) Printing to PDF instead of PS won't have any visible benefit to the user, other than maybe a somehow shorter printing time since there won't be one conversion less in the chain

> 
> > Postscript printing should still
> > be supported by Ubuntu,
> 
> It is.

No it is not, i've spoke with Till this morning and he has agreed there is a problem printing some Postcript files and it is something they have to fix, actually he told me he has a fix for it already and will be pushed shortly fixing your problem printing in Okular

> 
> > and if it is not, it is their problem they decided to
> > move away from the default printing
> 
> The new default is to sent jobs to CUPS as PDFs.

Yes, the issue as I said is we support more printing systems than CUPS
Comment 8 Jan-Marek Glogowski 2015-03-10 10:45:04 UTC
This is a real problem for us. We (City of Munich) generate large mail merge documents (PDF with 4k - 8k pages, some even 16k), which we want to print from KDE. Generation using LibreOffice + WollMux takes ~2 hours, but even with the latest GhostScript 9.15, which is 50% faster then the GhostScript version shipped in Ubuntu Precise, it takes more then a day for poppler (0.24.x) just to generate the PostScript to be send to the CUPS server. And additionally we still have the conversation to PCL for the printer on the CUPS server side. 

Using a printer, which supports direct PDF printing, would get the time down to just the file transfer time, if Okular would actually send the PDF.

And for some of our test documents the generated PS is much larger (8-10 times, talking about GB here) then the original PDF, which is written to tmp and "copied" to /var/spool for local CUPS or send to a central print server.

If you still think this is not a bug, it would be nice to get some code pointers in current KDE4 okular codebase, so we can probably hire someone to get this fixed and included Upstream.
Comment 9 Albert Astals Cid 2015-03-11 23:55:42 UTC
Changing the pdf printer to just pipe the pdf file is quite trivial, you should not really need to hire anyone for it since it's a 5 minutes patch in PDFGenerator::print

The problem is testing that everything still works, since sure, you're use case may get better, but there's lost of other people printing out there and it may break for them.

I can give you the five lines patch and then you donate to http://kde.org/donate instead of hiring someone to code it, but i do not think i have enough stamina to test all the printing test cases, is that something you could help with? (i.e. printing smal documents, different page sizes into different page sizes, etc)
Comment 10 Jan-Marek Glogowski 2015-03-12 08:43:14 UTC
The initial patch would be great. We'll get this tested before production anyway and I can report back or probably even send patches, which fix stuff.

It's not that we're not coding stuff ourself, but I thought it would be more work to get this coded, and we already buy Linux support, which patches upstream code, if we don't code the stuff ourself.

Additionally I would add some option to okular to select the default printing format (PDF or PS - like LibreOffice) to really get this feature included upstream (defaulting to PS). We normally require upstream / master fixes before including a backport in our release, so we don't have to re-patch everything within our next major release cycle.
Comment 11 Albert Astals Cid 2015-03-14 15:40:14 UTC
Please see and test the pdfprintpdf branch.
Comment 12 Albert Astals Cid 2015-03-27 21:44:57 UTC
So no testing after 2 weeks?
Comment 13 Jan-Marek Glogowski 2015-03-27 22:15:45 UTC
I just did a quick test and generally it works and sends the PDF to CUPS. So thanks again for this quick patch.
I currently don't have time to turn this patch into a really useable version and I don't know if anybody will add enought priority to it and work on it (I'm leaving for a holiday at least until July).
Comment 14 Albert Astals Cid 2017-08-11 23:25:10 UTC
*** Bug 309385 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Feck 2019-01-23 00:50:07 UTC
Could somebody clarify if the recently merged "raster" printing patches would avoid using ghostscript? Distributions are discussing to phase out ghostscript because of security issues, see e.g. https://bugzilla.suse.com/show_bug.cgi?id=1122797
Comment 16 Oliver Sander 2019-01-23 05:14:46 UTC
Yes, printing with 'rasterization' does not require ghostscript.
Comment 17 Oliver Sander 2019-01-24 08:06:11 UTC
Two other approaches to reducing the use of ghostscript are

  https://git.reviewboard.kde.org/r/130055/

and

  https://phabricator.kde.org/D7949
Comment 18 Albert Astals Cid 2019-01-26 19:07:09 UTC
As mentioned in comment #11 there's also the pdfprintpdf branch if someone wants to give it a look.
Comment 19 Oliver Sander 2019-01-26 22:20:57 UTC
The reviewboard patch I mentioned is the content of the pdfprintpdf branch.