![]() | Scripting |
priPrinter Script Reference, Samples
Script is a tool that allows you to automate tasks and add custom functionality to priPrinter. For example you may define your own page layout, delete or select pages based on your own criteria. Script may be executed manually by clicking on a special button in Quick Access Bar or automatically for each new print job.
Script allows you to:
For example you may print to priPrinter. Script automatically will apply required settings, print some pages to one printer, another set of pages to second printer and finally save a copy in pdf format to network drive. Of course everything can be done in background without any user interaction. In order to do this, you should put script into scripts folder and specify its name in printer preferences:

Or it is possible to launch script by clicking on button in Quick Access bar. In order to create such button click on Customize button and select "New Script Button". This script may select specific pages or allign pages in a very special way.

Sample script:
local doc=window.GetDocument();
if(doc.numpages)
{
local page=doc.GetPage(0);
if(page)
{
doc.DeletePage(0);
page=doc.GetPage(0);
local i;
for(i=0;i<10;i+=1)
{
local copy=doc.DuplicatePage(page);
copy.visibility=0;
}
}
}else MsgBox("Document is empty");
window.SetForm("simple");
window.SetFormMode("bind","cell");
priPrinter uses Squirrel programming language as base of scripting engine.
priPrinter Scripting is part of priPrinter Professional edition.