In this case a script can test the time of the print job. If during a particular time of day the job can be cancelled and a message sent to the user (via the user client software). Sample scripts are available as recipes and snippets within the PaperCut interface.
For documentation on Advanced Print Scripting see the manual.
Controlling with web-service or server command (before 10.1)
PaperCut comes with a comprehensive set of XML web services API’s and a set of command-line tools for use in traditional scripting environments such as batch files or shell scripts. These tools can be used to control accounts, settings and printer access. One example of their use is controlling printer access based on time of day. Here is an example on how to set this up:
This example assumes:
- PaperCut NG is set up on a Windows print server named “printsrv1”
- There is a printer access on the server called “labprinter”
- The administrator would like the printer disabled between 5:00pm and 8:00am on week days.
- in the location
C:\Program Files\PaperCut NG\server\custom
close-printer-access.batadd the text:
cd c:\program files\papercut ng\server\bin\win server-command.exe disable-printer “printsrv1” “labprinter” −1
- Note: The value
-1indicates to disable the printer forever - that is until is is manually re-enabled.
open-printer-access.batadd the text:
cd c:\program files\papercut ng\server\bin\win server-command.exe enable-printer “printsrv1” “labprinter”
close-printer-access.batand verify that the printer is disabled and printing is denied. Then Double-click on
open-printer-access.batand verify that printing is re-enabled.
Start->Control Panel->Scheduled Tasksto add two new tasks as follows:
- Schedule close-printer-access.bat to run on at 5:00pm on weekdays.
- Schedule open-printer-access.bat to run on at 8:00am on weekdays.
For more information see Scheduling server commands.