/* * 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 + "'."); } } ​