Printing multiple copies prints only 1.

Hello there,

I am currently solving this problem:

Our company uses postscript to print documents from our POS system based on Java and everything was working fine up until we reached OpenSUSE 15.0+. We can print multiple copies of a document and everything is working fine on older distributions of OpenSUSE and CUPS.

WORKING: every distribution up until 42.3
When I select print multiple copies, only 1 copy is printed.
The problem is NOT happening on every printer, just a few so it’s quite random.

Anyone facing similar problems when switching to 15.0+ distribution associated with newer version of CUPS ver 2.x.x + ?
When I manually send a command to print the generated document twice, it works just fine.

But when I try to print it straight from our system, it prints only one copy. Has anything changed in CUPS processing of postscript ? Is anyone facing anything similar ?

The printer I am currently trying is Samsung M2020 and in the provided .PPD there is a mention “*cupsVersion:<->1.1”
Which probably means that this driver is old and should be but probably won’t be updated in order to work in newer versions of CUPS.

Another printer not working is Brother 2340 and Brother 2352. Both of these printers have Linux drivers dated back to 2015. Samsung is from 2017.

I will be thankfull for any suggestions. I am also ready to provide necessary log files if needed. Thank you and have a great day!

This is the content of our generated .ps file.

%%EndProlog
%%BeginSetup
<< /PageSize [590.625 835.3125] /ImagingBBox null /ManualFeed false /NumCopies 2 >> setpagedevice.
%%EndSetup
%%Page: 1 1
/pgSave save def
835.3125 0 exch translate 1 -1 scale[72 300 div 0 0 72 300 div 0 0]concat

So it looks to me that this argument “/NumCopies 2” is ignored in newer versions of CUPS.

This is from error_log

d [24/Jun/2020:15:17:29 +0200] cupsdProcessIPPRequest: copies integer ‘1’

@HonzaK:

After Leap 42.3, CUPS moved to PDF for the data being sent to the printer and, away from Postscript.

You may have to inspect the following CUPS documents:“Developing PostScript Printer Drivers”: <https://www.cups.org/doc/postscript-driver.html>.
“CUPS PPD Extensions”: <https://www.cups.org/doc/spec-ppd.html>

There’s also some Ghostscript documentation related to Postscript: <https://ghostscript.com/doc/cups/libs/filter/postscript-driver.shtml>.

Thanks for your answer. How about backwards compatibility ? I understand the fact that CUPS moved from postscript to PDF, but shouldn’t it still provide backwards compatibility ?

AFAICS, CUPS still supports Postscript: <https://www.openprinting.org/driver/Postscript/&gt;.

  • But, you may to make some changes to get your “always 2 copies” case back up and running.

Actually, that (PDF-based workflow) happened with CUPS 1.6.x onwards. CUPS 1.7 was used in Leap 42.1
https://doc.opensuse.org/release-notes/x86_64/openSUSE/Leap/42.1/#fate-314630

Yes, this reads like some other regression at play. Does this problem only occur with your java application?

Yes. And it works everywhere else except on CUPS version 2+ which is present on OpenSUSE 15+

Ok, this will likely require a bug report.

https://bugzilla.opensuse.org/

However, some diagnostic information will be needed. Put CUPS into debug mode first

cupsctl --debug-logging

Then you can send a print job and examine the CUPS error log (/var/log/cups/error_log).

This Fedora CUPS Troubleshooting guide may be helpful here.

Okay. I have generated a log file and created a ticket at bugzilla.

That was quick! For others who may come searching…

https://bugzilla.opensuse.org/show_bug.cgi?id=1173345

Forgot to attach the link, sorry. Thank you for your suggestion :slight_smile:

All good. I’m following with interest now. :wink:

@HonzaK:

The Release Notes point to “Concepts printing” <https://en.opensuse.org/Concepts_printing&gt;.

  • Which details what Postscript print jobs now have to do.

The Release Notes also mention that, some printing filters and back-ends have been moved to the cups-filters package.

SUSE 42.3 along with CUPS 2.2.7 works just fine. So the problem IS in the system most likely or in one of the filters.

Perhaps check the filter chain (using the cupsfillter command)…
https://forums.opensuse.org/showthread.php/537583-CUPS-1-x-to-2-x-problems-SOLVED
then run the filters by hand (as per the CUPS troubleshooting guide I linked to already). You could also compare the output (at each stage) with openSUSE 15.x perhaps. I can only speculate, but I wonder if changes to ghostscript processing may be impacting here?

I have managed to downgrade cups-filters 1.25.0-lp152.1.8 (OpenSUSE 15.1 repo) to 1.8.2-3.1 (from OpenSUSE 42.3 repo) and the print job now works correctly. Now to find out which one of those filters is doing the problem.

GSTOPDF
PDFTOPDF
GSTORASTER
RASTERTOSPL - this one is not a part of cups-filters so this one is OK

PDFTOPDF is not the problem as well. I have tried swapping PDFTOPDF filter from old version into the new version but without any effect.

So the problem most likely lies within the GSTOPDF filter. I have tried using the PSTOPDF filter from 1.8.2-3.1 along with GSTORASTER + PDFTOPDF from 1.25.0-lp152.1.8 and it works just fine, as long as I rename PSTOPDF → GSTOPDF.