[cups] Possibility to run a script as part of print workflow?

Massimiliano Ritossa ritossa at sissa.it
Fri Sep 22 00:27:17 PDT 2023


Hello Jeff,

As you said  Tea4Cups is rather obsolete and unsupported but it’s yet useful for learning howto.
Pykota (http://www.pykota.com) is the evolution of Tea4Cups, among many features it also calculates the number of pages.

Well, if you only need the # of printed pages is sufficient to download pkpgcounter pkg, available in the software section of pykota site.
You can write your own backend that include pkpgcounter to get the # pages and then sumbits the job to the printer.

In the end, i suggest you a very useful link for this argument: https://en.opensuse.org/SDB:Using_Your_Own_Backends_to_Print_with_CUPS

Cheers,
MAx


On 21 Sep 2023, at 22:37, Jeff Dyck <fsjjeff at gmail.com<mailto:fsjjeff at gmail.com>> wrote:

Hello all,

I’ve been trying to research a manner of injecting a script into the CUPS workflow to parse the ARGV[5] arguments in an IPP-Everywhere workflow.  Lots of Google searches have pointed me to Tea4Cups, but after a lot of playing around it seems rather obsolete and unsupported.

Thanks in advance to anyone who can point me in the right direction to find a way to have a script run against all print jobs...


More details for those who want them:

Basically we’ve moved to a complete CUPS based print system for our Macs and iOS devices, utilizing IPP-Everywhere and DNS-SD based discovery for driverless printing on all our devices. In general this has been very promising, EXCEPT our PaperCut accounting / tracking solution doesn’t know how to parse IPP-Everywhere print jobs (even though all the data is sitting there right in the command line arguments of the jobs) and completely screws up how it logs those jobs…

Specifically it strips off the copies attribute (argv[4]), and doesn’t properly parse color vs monochrome, and on more recent versions of the PaperCut Provider even seems to strip out additional attributes like duplex and finishing options.

I’m hoping to create a script that would use a PDF parser command line tool to tell me # of pages (and perhaps even the balance of B&W vs color pages), and then parse the arguments to see whether it’s a color or B&W print, duplex, and other options selected and copies and then use the PaperCut API to upload that data direct…

Sadly after long talks with PaperCut they’ve basically told us they’re aware they have no IPP-Everywhere support, that it’s on the list for “eventually”, but after nearly 2 years now I still have no idea when or if it’s ever something they will tackle and could we just leave them alone…

Jeff
_______________________________________________
cups mailing list
cups at cups.org<mailto:cups at cups.org>
https://lists.cups.org/mailman/listinfo/cups



More information about the cups mailing list