img

PaperCut Print Script of the Month #11 Setting queue timeout for WebPrint


PaperCut Print Script of the month

This month we are going to look at making sure the jobs sent by users over the weekend through WebPrint are not cancelled by the hold/release settings. Grab a cup of coffee and we can be started.

The first step will be working out how we can tell the source of the print job. Luckily there is a method that does this for us inputs.job.jobSourceName() this would return the name of the user’s machine, but if you are using Google Cloud Print it will be GOOGLE_CLOUD_PRINT, For WebPrint it will be WEB_PRINT and if you are using Email to Print, it will be EMAIL_PRINTING. Now we know what it does and what we should be looking for we can start building our PaperCut Print Script.

Inside this if statement we will only be dealing with Web Print jobs so all we need to do now is override the system set Hold/Release Timeout option which we can do using actions.job.setHoldReleaseTimeout() the minimum value for this is 5 minutes but we want to set it a little bit higher to maybe 2 days (2880 minutes) which cover us for any jobs printed over the weekend. With this option in place our if block will now look something like this.

Now we could stop here, but this setting would also impact jobs printed during the week which we don’t want to happen. To get around this, we need to take the lines above and make use of Javascript date methods so we can detect if it is the weekend or not, To do this we will check the Date.GetDay() for a 6 or a 0 where 6 is Saturday and 0 is Sunday.

That is it for this month and as always the complete PaperCut Print Script is below. If you have your own requirements for a print script and you don’t have the time or in-house experience to make it you can find out how we can help you by getting in touch with our sales team.

Get in touch today | sales@selectec.com

PaperCut Print Script
Latest News from Matt Smith
img

RFID Card Reader Basics

Here at Selectec, hardly a week goes by without one or more of us getting aske...

Written by: Matt Smith

More
img

Job Ticketing, FabLabs and Mini Rooms

PaperCut has recently added different room types to Job Ticketing as a way to h...

Written by: Matt Smith

More

img

We have worked with Selectec for a considerable time now and have installed their Print Management Software into some of our largest accounts. They have proved themselves as an excellent partner to work with and have always been willing to go the extra mile when required

Chris Beale Copyrite Ltd
This website works best using cookies which are currently disabled. We use cookies to help with our site analytics to improve our services.
Back to Top ↑