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

Mobility Print from Ubuntu Client

Mobility Print from Ubuntu Client   Everyone loves Mobility Print from P...

Written by: Matt Smith

More
img

Free Exam Time Printing PaperCut Script

The PaperCut script request... Recently, we were asked for a PaperCut script t...

Written by: Matt Smith

More

img

We have worked with Selectec for a number of years now and they are the perfect PaperCut partner for us. The support team is fantastic and knowledgeable and the sales staff are superb. With the high level of service we get from Selectec we have no reason to consider using anyone else.

Martin Croft Direct-tec Group 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 ↑