apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.95k stars 464 forks source link

CUPS prints number of copies squared #5015

Closed CrazyCasta closed 7 years ago

CrazyCasta commented 7 years ago

I'm not exactly sure what's causing this, but I'm assuming copies is getting processed twice somewhere. My setup is:

printers ... raw CUPS print server (to handle windows as well as cups clients) ... clients (both windows and cups)

Windows clients print just fine. For instance if I ask for 2 copies I get 2 copies. CUPS clients print copies squared. So when I ask for 2 copies I actually get 4.

CrazyCasta commented 7 years ago

P.S. By saving the job at the raw server I can see that the input is a (gzipped) PCL document containing 4 pages. So the problem happens somewhere before the job gets to the raw server.

michaelrsweet commented 7 years ago

What version of CUPS?

What OS/Distribution?

CrazyCasta commented 7 years ago

Cups 2.1.4 on gentoo linux.

msaesis commented 5 years ago

Good morning Mickael,

I know this issue is close, but we are experiencing on Ubuntu 18.04 with CUPS 2.2.7 this strange problem. So I post a comment here, hoping this is the right place.

We use Ubuntu 18.04 clients to print to raw queues on a Ubuntu 18.04 server. We do this for print accounting and control in our application.

We do many many tests, on Ubuntu 18.04, Kubuntu 18.04, Ubuntu 19.04, and to finish, on Debian 9 (with CUPS 2.2.1)

For our testing, we create a printer called MYREMOTEPRINTER . This is the name of the raw queue on server and, to keep it simple, the name of the printer for the clients.

Each time we print a document (from Firefox, evince, and many others applications), asking 2 ou more copies, we get 2^2, or 3^3 and so on copies. Same behavior if we print from command line ("lp -d MYREMOTEPRINTER -n 2 MyDocument.PDF").

A document of 3 pages, 2 copies, will generate 3 * 2^2 pages = 12 pages instead of 6. And if you want to print just a unique page, 10 copies, you will get 100 pages !

This problem doesn't exist on Ubuntu 14.04 with CUPS 1.7.2

The same problem has been opened on Launchpad : https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1785644

We discovered also that if we declare the remote printer as : lpd://REMOTESERVER/MYREMOTEPRINTER instead of ipp://REMOTESERVER/printers/MYREMOTEPRINTER

(and declare cups-ldp in inetd.conf, of course) problem is not present.

My question : why bug #5015 has been closed ? Is it really solved ?

This doesn't seem just an Ubuntu bug (Debian has same problem, I can test on Fedora too). How to explain that changing the protocol used to transmit data from clients to server (from IPP to LPD) seems to solve the problem ?

Do you think this could be solved in a next release ? A backport or patch could be available for current releases ?

Best regards Marco from France

michaelrsweet commented 5 years ago

@msaesis The copies-squared problem is always caused by a misconfiguration - when the Client runs local filters it produces copies, but then the server sees the print file from the client as plain old PostScript and extracts the number of copies from the PostScript headers, leading to double copies.

You need to use the IPP Everywhere driver on the clients (or raw queues, which are deprecated but have a similar effect) so that all of the driver processing happens on the server.

msaesis commented 5 years ago

Thank you for your answer.

But, this kind of configuration works fine on CUPS 1.7.2 and Ubuntu 14.04 (which use that version of CUPS) just reached EOL in April 2019. So, my questions are :

I haven't still studied all possibilities of "IPP driverless" or "IPP Everywhere" model, but it seems to me that direct communication between client and printer is necessary, so how to have a print server to control and count user printings ? And what about compatibility ? I haven't seen many manufacturers (but HP) speaking about "IPP Everywhere" compatibility in their technical specifications (Kyocera, Toshiba, ...)

Thanks for your help and your advice Marco

michaelrsweet commented 5 years ago

@msaesis Using LPD flags the job as raw on the server. And in the case of Windows clients you will always have problems because most drivers expect to be talking directly to the printer and have never been tested over IPP.

As for what changed, I have no idea. CUPS is just part of the printing system on Linux and filter and driver changes can often break things in unpredictable ways - that's one of the reasons we have been pushing so hard for IPP Everywhere/AirPrint support (98+% of all printers support AirPrint, about 10% explicitly support IPP Everywhere, more are coming!)