CUPS Printing: Is there a way to get total page count when print job begin

cups

Now I only can get actual page count from querying print job attribute after print job finishes. I found that page count increases on "localhost:631/jobs" during printing.

What I want is get page count before the first page is printed, because I want tell printer this data before sending any print data.

Best Answer

This would only be possible with a postscript/PDF document, where your document's pagination information is passed to the device. Otherwise, you won't know this information ahead of time.

I encounter this on production and unattended printing systems when I need collation or stapling features. Those functions don't work without having an accurate page count.

Can you explain what you're trying to accomplish, the printers involved, the application and OS?