Please enable JavaScript to view this site.

PDF Image Printer

The Run Commands tab holds all settings related to specifying a specific command or running a program while printing to PDF 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 PDF Image Printer. PDF 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:

Using Environment Variables and Registry Keys

Signaling Events Using Run Commands

 

ProfileManagerRunCommandsTab-PDF

Using the Command Editor

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.

Movie Add-WF

Start of Job - Adds a command that will run when the print job starts. This command is always run.

Movie OK-WF

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.

Movie Delete-WF

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.

Movie Save-WF

End of Job - Adds a command that will run when the print job completes. This command is always run.

Up Arrow_1

Collapse Row - Use the close arrow icon to hide the command details

Arrow Up_01Arrow Down_02 

Move Up/Down - The arrow icons are used to change the order or the commands within each group.

Delete_05

Delete - Click the trash bin to delete unwanted commands.

Editing Command Details

Enable this command

When a new command is added, this setting starts out disabled. Enabling this setting means PDF Image Printer will run the command at its designated stage when printing.

Run command on

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.

Run this command

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 PDF Image Printer will accept run commands with any file extension including .com, .cmd, or PowerShell files. PDF 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.

Use these parameters

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 PDF Image Printer. PDF Image Printer. If no files are generated, neither the success or the failed commands are run.

Starting folder for command is

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.

Run Command Macros

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.

Output Variables

$(FileGUID)

A GUID (Globally Unique Identifier) for this file, this alphanumeric number is unique.

$(JobGUID)

Current job GUID (Globally Unique Identifier) maintained by the driver, this alphanumeric number is unique.

$(JobID)

Current job ID maintained by the driver for this printer. Increments for every print job. This number is shared across all copies of the PDF Image Printer printer and stored as a UInt64 with a maximum value of 18,446,744,073,709,551,615.

$(JobStatus)

1 indicates success, 0 indicates failure

$(OutputDir)

The output directory where the files are created. The directory string is passed in quotes. This macro cannot be used with the PNStart12.exe utility.

$(OutputDirNoQuotes)

Same as $(OutputDir), but without quotation marks. This macro cannot be used with the PNStart12.exe utility

$(PageOrientation)

The orientation of the first page of the output pages, either "Portrait" or "Landscape".

$(PrintJobID)

The job ID from the print queue; this job id increments for every print job. It is not unique and numbers can be repeated.

$(PrintedPageCount)

The number of pages printed.

Date and Time Variables

$(Year)

The year the job was started.

$(Month)

The month the job was started, two digits, 01-12.

$(Day)

The day the job was started, two digits, 01-31.

$(Hour)

The hour the job was started, two digits, 24-hr format, 00-23.

$(Minute)

The minute the job was started, two digits, 00-59.

$(Second)

The second the job was started, two digits, 00-59

Other Variables

$(PrinterName)

Name of the printer that printed the file.

$(Copies)

The number of copies chosen in the print dialog. This number is not used, just passed on as information.

$(Collate)

Any collation settings chosen on the print dialog.

0 if collate was not checked

1 if it was checked

$(Duplex)

Any duplex settings chosen on the print dialog.

1 = No duplex

2 = flip page on long edge

3 = flip page on short edge

$(Color)

The color setting used when printing the document.

1 = Black and White

2 = Color