Last active
August 4, 2021 00:01
-
-
Save henri/9123dbcd0a3d5332303a4edd1c30a2e1 to your computer and use it in GitHub Desktop.
PaperCut Reject Jobs Not Redirected From Another Print Queue - PaperCut Application Server Printer Scripting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Rejects Jobs Sent Directly, Redirected Jobs from other queues (eg. redirected from Find Me / Follow Me print queues will print as this script will not run on redirected jobs). | |
// Copyright Henri Shustak | |
// Licence : MIT <https://mit-license.org> | |
// | |
function printJobHook(inputs, actions) { | |
var username = inputs.job.username; | |
var printername = inputs.job.printerName; | |
var client_ip_address = inputs.job.clientIP; | |
var job_canceled_log_message = "Job Cancled! Job was not sent via XYZ Queue - " + username + " - " + printername + " - " + client_ip_address ; | |
var job_canceled_message_to_user_options = {"dialogTitle" : "Print Job Canceled", "hideJobDetails" : true, "dialogDesc" : "<HTML><H3>Please contact IT Support.</H3></HTML>"}; | |
var job_canceled_message_to_user = "<html>Please contact IT support for installation of the print queues onto your computer. You may also <a href='http://my.domain.com/printqueues_installer.dmg'>download and install yourself</a>.</html>"; | |
// add comment to job history | |
actions.job.cancelAndLog(job_canceled_log_message); | |
// log to papercut log | |
actions.log.info(job_canceled_log_message) | |
// message user client | |
actions.client.promptOK(job_canceled_message_to_user, job_canceled_message_to_user_options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PaperCut API Documentation : https://www.papercut.com/support/resources/manuals/ng-mf/common/topics/script-print-api.html