OpenPrinting / cups-filters

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
157 stars 125 forks source link

pdftopdf produces blank document when using -o fit-to-page from apparently correct input #545

Open maganap opened 1 year ago

maganap commented 1 year ago

Describe the bug I'm using cupsfilter to transform PDF files to PostScript before sending to the printer. Some files print completely blank, with the correct number of pages, though. I noticed the problem is produced only when adding the -o fit-to-page option. If I skip this option, the file prints out properly.

I use evince to view the PS files before printing, which do show blank as well (or properly when -o fit-to-page is omitted).

This only happens to some files, but I can't find any errors in the input files. I also tried to repair the input file (with gs) before using cupsfilter, with the same blank result. pdfinfo and other tools I used didn't show any errors either.

To Reproduce I narrowed it down to this:

# works.pdf produces correct output
cupsfilter -m application/vnd.cups-pdf -o fit-to-page -- works.pdf > works_out.pdf

# fails.pdf produces blank output
cupsfilter -m application/vnd.cups-pdf -o fit-to-page -- fails.pdf > fails_out.pdf

Here you have works.pdf and fails.pdf for this test. Also my works_out.pdf and fails_out.pdf in case it's useful.

Expected behavior The output PDF should look similar to the input PDF.

System Information:

Extra information

But I could't find any wrong page size (like 0 page size to become blank) with pdfinfo.

Your help is very much appreciated. Thank you in advance!

maganap commented 11 months ago

Any ideas here? Please :( this is causing a lot of trouble to us. Thanks