Bugzilla – Bug 156300
CUPS support for poppler
Last modified: 2008-06-25 09:38:50 UTC
CUPS currently uses xpdf2 derived code for pdftops, resulting in the regular exploit-of-the-month. I've looked at replacing the shipped code with poppler for pkgsrc and the result is ftp://packages.stura.uni-rostock.de/patches/cups-poppler.diff It might need some munching of the include paths to find the poppler headers. It would be nice to coordinate efforts (esp. a possible upstream merge), since this is IMO interesting for SuSE as well. The code lacks some testing. Basic operation including resizing seem to work, but the advanced features like Duplex etc. are untested.
I've mixed feelings about applying such patches: While it is in general a good idea, xpdf interface code is fragile and replacing the code can produce quite some subtle problems.
I had a quick look at the poppler diff, and maybe I didn't catch every point, so please correct me, if I'm wrong. First of all, I'm sorry to say, but we are at feature freeze for 10.1 since quiet some time. Introducing poppler means, a major feature with major effort for all the other packages too. ==> TOO LATE :( Second, if you want to introduce poppler to the main CUPS code, go to http://www.cups.org/str.php and make a bug report of priority "enhancement". This is the best way to do. Then SUSE ain't doing it on its own way, while SUSE customers are bared out from the CUPS mailing lists then. Third, having a closer look at the code, I can tell you, that we run into some cyclic problems in the build of packages. Poppler requires some non-basic packages, like FreeType2, qt4 or glib, to build. But qt/glib requires (indirectly) a cups package to get build, and cups requires poppler to get build. Gotcha. :( We run into a problem which package needs to be build first... Finally CUPS currently uses xpdf-2.02 with some additional features. Those features need to be introduced into poppler library and have to work, if poppler library is called by some other programs like xpdf, kpdf, pdftex etc. The same is valid for the changes to xpdf by kpdf/pdftex/... But good news is, that the CUPS author Mike Sweet is in good contact with Derek, author of xpdf. So I think the changes for the CUPS part aren't to difficult to do. The good news is: the duplexing of the CUPS system is currently not done by the PDF part, instead it's done in the pstops part. This is not a problem. But the adaptions of xpdf to work as a cups filter are the problem. I like the idea of having poppler in the distribution. I thought already on some solution how to introduce the xpdf system as a replacement of pdftops, and poppler seems now to be the solution for me. But adding poppler requires a major change in our system, to gain the benefits. I would say, this can't be done for the next SUSE Linux version at the moment.
AJ, I think it's a good idea to have poppler in one of our next SUSE Linux versions. Can you please handle all the necessary management tasks to get poppler used by: xpdf, gpdf, kpdf, koffice, tetex, pdftohtml, cups ==> reassign.
I'm fully aware of the feature freeze. bout the cyclic dependency, it should be possible to handle by splitting of libpoppler-qt and libpoppler-glib, reducing the dependency list to FreeType2. I've submitted the entry for CUPS (ID 1471). I'm also working on extracting the local changes from CUPS. The initial review was that beside the PSFit attribute and some const additions no API change was introduced locally.
Yes, let's investigate this closer for 10.2, I'll take care of it.
Marking it as an enhancement request to better reflect that this is 10.2 work.
Klaus, could you take care of this, please?
Sascha Sommer, familiar with the printing system, made a patch for cups to support poppler (during my summer holidays). We need to change poppler to get some additional functionality. Patches will be attached soon. After those patches (JPR please apply with care) are in, I can change cups.
Created attachment 101581 [details] Poppler fix to generate necessary PostScript headers
Created attachment 101582 [details] Poppler fix to suppress hidden annotions
Created attachment 101584 [details] Poppler fix to render a specific page
Created attachment 101585 [details] CUPS patch to use poppler (1st try, not complete) This patch is not complete, as it seems not to support to print a page range our of a PDF document. But it is a first shot, good to test with.
Have any of these been submitted upstream for review yet? I don't think my team has enough expertise to review these patches.
I submitted them to the cups maintainer (who made these changes for xpdf) but I did not receive an answer yet. See http://www.cups.org/str.php?L1471+P0+S-2+C0+I0+E0+Qpoppler
is done in a different way. modifying the document for poppler call with an additional program, then calling poppler-tools. fixed in 11.0