Comment 3 for bug 382379

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

In the beginning, CUPS shipped a pdftops filter based on the /usr/bin/pdftops utility of Poppler. It produces DSC-conforming PostScript which can easily be processed by further filters. It also leaves text as text and embeds the fonts. Its problem is that it does not support documents with multiple page sizes. In this case it scales all pages to the size of the first page (bug 310575, https://bugs.freedesktop.org/show_bug.cgi?id=19777).

To get around that, and also in the hope to get color management working more quickly, I switched to Ghostscript for the pdftops filter in CUPS. It solved the multiple-page-size problem perfectly but caused several other problems.

I started with the "pswrite" output device of Ghostscript. Its output is also DSC-conforming, but it turns all text characters to bitmaps, causing huge PostScript files (bug 377011), broken text characters (bug 362186), slow job processing (bug 289852), output files which are not searchable (bug 381788).

So I tried the "ps2write" output device of Ghostscript. Its output is not DSC-conforming, so it can only be used in the pdftops filter when the PDF workflow is used, where the page manipulations are done by the pdftopdf filter which runs always before pdftops. In the upstream CUPS without filter additions incoming PDF is turned to PostScript by the pdftops filter and after that the pstops filter does the page management and this requires DSC-conforming PostScript. It actually solved the problems of "pswrite" producing a PostScript of reasonable size and with embedded fonts, but it is still not perfect, for example it produces code which does not run on some PostScript printers (bug 377011) and the text searchability is also not perfect (bug 381788).

As it turns out that Ghostscript has too many problems in its two PostScript output devices, I am looking into returning to Poppler, as they have only the one minor problem of the multiple page size output, which I have fixed. I have submitted the patch upstream (see https://bugs.freedesktop.org/show_bug.cgi?id=19777) and I also attach a debdiff for the Ubuntu package of Poppler. This adds a new output mode to the PostScript output device of Poppler which conserves the original page sizes and orientations.

Once this new Poppler versions is uploaded, we can change the pdftops filter of CUPS to use Poppler and patch it to use the new "-origpagesizes" option for the /usr/bin/pdftops call.