The Run Commands tab holds all settings related to specifying a specific command or running a program while printing to TIFF Image Printer. There is are three stages at which commands can be run:
•at start of the printing process
•after a successful or failed print
•at the end of the printing process
Multiple commands of each type can be added to chain together custom actions as needed. Commands can be enabled or disabled individually, and will run in the order set within each stage by moving them up or down in the grid view. Commands are run sequentially in the order given, with each command finishing before moving on to the next one.
The commands that run on a successful or failed print automatically create a text file containing a list of files generated. This text file can contain zero or more lines, with each line being the full path to a file generated by TIFF Image Printer. TIFF Image Printer will pass the full path of this text file (pnf-<GUID>.txt) when executing the success or failure command. If no files are generated, neither the success or the failed commands are run.
Commonly used run commands have been provided in the RunCommands folder in the product installation folder, and custom run command files (.bat, .exe. or .com) can be created to meet specific requirements. When using a command from the RunCommands folder under the product setup, the location of the command is stored in the profile using a macro. This allows the profile to work on any computer, no matter where the product is installed. It also allows users the freedom to add their own commands to this folder as part of deployment and they will automatically be found.
See the topics Using the Run Commands for examples of using the provided commands.
For advanced users and programmers automating the printer, environment variables and registry keys can be used to specify all or part of the paths and parameters for the commands. The run commands can also be used to signal events in other programs. For examples of this see the following topics:
The Command Editor allows users to add new commands for each stage, move the commands up and down for each stage, delete commands, edit existing commands. and change which stage a command runs.
To edit a command, hover over the command in the list until it is highlighted, and click to edit its details.
•Start of Job - Adds a command that will run when the print job starts. This command is always run.
•On Success - Adds a command that will run when the print completes and is successful. This command is always passed a last argument of a path to a text file containing a list of files generated.
•On Failure - Adds a command that will run when the print job fails, such as when out of disk space. This command is always passed a last argument of a path to a text file containing a list of files generated.
•End of Job - Adds a command that will run when the print job completes. This command is always run.
•Collapse Row - Use the close arrow icon to hide the command details
•Move Up/Down - The arrow icons are used to change the order or the commands within each group.
•Delete - Click the trash bin to delete unwanted commands.
When a new command is added, this setting starts out disabled. Enabling this setting means TIFF Image Printer will run the command at its designated stage when printing.
This is the stage during the print cycle at which the command will be run, one of Start of Job, Success, Failure, or End of Job.
Enter the full path to the command you want to run. If this string is left empty, a warning message will appear when printing,
Select the run icon to browse to your desired run command or enter in the absolute path (for example, C:\My Files\RUNCOMMAND.exe) of the run command to be used. Environment variable like %userprofile%, %username%, and %systemroot% can be used in the command string.
The most common run commands are executable files (.exe) or batch files (.bat), but TIFF Image Printer will accept run commands with any file extension including .com, .cmd, or PowerShell files. TIFF Image Printer will attempt to execute any run command entered. If the command is not runnable, you will receive any error indicating that it could not be run.
A command preview will appear for anything entered in the command string, including any possible expansion of environmental variables and run command macros.
Type any parameters you need to send to your application.
When entering parameters:
•Use blank spaces to separate parameters.
•Enclose parameters that contain spaces in double quotation marks.
Environment variable like %userprofile%, %username%, and %systemroot% can be used as parameters. Run command macros can also be used.
The On Success and On Failure commands will automatically add the full path to a generated text file (pnf-<GUID>.txt) as the very last parameter when executing the command. This text file can contain zero or more lines, with each line being the full path to a file generated by TIFF Image Printer. TIFF Image Printer. If no files are generated, neither the success or the failed commands are run.
You can specify a default working directory for your application. Select the folder icon to browse to your desired working directory or enter in the absolute path (for example, C:\My Files) of the directory to be used. If the path entered does not exist, the folder will not be automatically created and therefore the driver will not run the command. Environment variable like %username%, %systemroot% can be used in the starting folder.
Although designating the starting folder is not frequently required, you may need to designate the starting folder if your run command requires that the working folder be a specific folder.
These macros can be used in the command, parameter and starting folder fields. They are automatically expanded to their values when the command is run.
A GUID (Globally Unique Identifier) for this file, this alphanumeric number is unique.
Current job GUID (Globally Unique Identifier) maintained by the driver, this alphanumeric number is unique.
Current job ID maintained by the driver for this printer. Increments for every print job. This number is shared across all copies of the TIFF Image Printer printer and stored as a UInt64 with a maximum value of 18,446,744,073,709,551,615.
1 indicates success, 0 indicates failure
The output directory where the files are created. The directory string is passed in quotes.
Same as $(OutputDir), but without quotation marks.
The orientation of the first page of the output pages, either "Portrait" or "Landscape".
The job ID from the print queue; this job id increments for every print job. It is not unique and numbers can be repeated.
The number of pages printed.
The year the job was started.
The month the job was started, two digits, 01-12.
The day the job was started, two digits, 01-31.
The hour the job was started, two digits, 24-hr format, 00-23.
The minute the job was started, two digits, 00-59.
The second the job was started, two digits, 00-59
Name of the printer that printed the file.
The number of copies chosen in the print dialog. This number is not used, just passed on as information.
Any collation settings chosen on the print dialog.
•0 if collate was not checked
•1 if it was checked
Any duplex settings chosen on the print dialog.
•1 = No duplex
•2 = flip page on long edge
•3 = flip page on short edge
The color setting used when printing the document.
•1 = Black and White
•2 = Color