neonetman Posted September 16, 2021 Posted September 16, 2021 Good morning, We have a student virtual print queue in Papercut whivh I'm told is supposed to release and grayscale jobs automatically to a specific printer, yet hold colour jobs for release by a teacher. I'm struggling to see how this is/can be configured (I'm fairly sure it's not doing that at the moment). Has anyone got any tips for how to achieve this?
bald_pig Posted September 16, 2021 Posted September 16, 2021 (edited) Adding this script to the grayscale queue should do it. Set the name of your colour hold queue for the variable. /** Redirect colour jobs without confirmation**/function printJobHook(inputs, actions) { /* * This print hook will need access to all job details * so return if full job analysis is not yet complete. * The only job details that are available before analysis * are metadata such as username, printer name, and date. * * See reference documentation for full explanation. */ if (!inputs.job.isAnalysisComplete) { // No job details yet so return. return; } var LIMIT = 100; // Redirect jobs over 100 pages. /* * NOTE: The high-volume printer must be compatible with the source printer. * i.e. use the same printer language like PCL or Postscript. * If this is a virtual queue, all printers in the queue must use * the same printer language. */ var COLOUR_PRINTER = "Colour printer"; if (inputs.job.isColor) { /* * Specify actions.job.bypassReleaseQueue() if you wish to bypass the release queue * on the original printer the job was sent to. (Otherwise if held at the target, * the job will need to be released from two different queues before it will print.) */ actions.job.bypassReleaseQueue(); actions.job.redirect(COLOUR_PRINTER, {allowHoldAtTarget: true}); // Notify the user that the job was automatically redirected. actions.client.sendMessage( "The print job has been sent to " + " printer: " + COLOUR_PRINTER + "."); // Record that the job was redirected in the application log. actions.log.info("Colour job redirected from printer '" + inputs.job.printerName + "' to printer '" + COLOUR_PRINTER + "'."); } }colour_redirect.txt Edited September 16, 2021 by bald_pig 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now