Variables

Note: Print Distributor has now been discontinued.

There are a number of variables available to include in a template or use with the Script and PowerShell actions:

Color Copies DataType DocumentName DriverName Duplex ID LastPrinter MachineName NotifyName Now Orientation PaperLength PaperSize PaperSource PaperWidth PortName PrintDate PrinterName PrintFilePath Priority SerialNumber Size TotalPages UserName

You can also create your own variables using the PowerShell action.

Color

Set to 1 for monochrome documents or 2 for colour documents.

Note this may be set to 2 even if the document does not contain colour elements.

Copies

The number of copies of the document. Multiply this by TotalPages to get a count of the physical pages printed.

Note: This field may not be accurate depending on where the print originated, prints arriving via LPD or from Windows 9x will not have a correct value.

DataType

The type of data used to record the print stream. This will usually be one of RAW or NT EMF 1.008

DocumentName

The name of the document printed, typically this is the path to the file but it can be another value and is dependent on the application software that printed the document.

DriverName

The name of the printer driver used to create the raw print stream, in a client-server situation this will usually be the name of the printer driver on the client.

Duplex

1 if the document is single sided, 2 for duplex.

ID

Windows allocates an identifier number for each document which you can include in a template. These numbers are recycled so are not guaranteed to be unique. If you need a unique number you should use the SerialNumber variable.

LastPrinter

The last printer referenced by the Reprint action, this is typically used after a Failover or Load Balancing action where you need to know which printer was used.

MachineName

The name of the computer that created the original print document.

NotifyName

The name of the user that receives print notifications.

Now

The date and time Print Distributor started processing the print document. This can be different from the time the user submitted the document.

Orientation

The page orientation, this can be overridden for individual pages within the document.

PaperLength

The length of the page in millimeters.

PaperSize

The size of the page, values are available at https://msdn.microsoft.com/en-us/library/windows/desktop/dd319099(v=vs.85).aspx

PaperSource

The paper tray that was selected in the printer properties or from the application program.

PaperWidth

The width of the page in millimeters.

PortName

The name of the printer port the printer used.

PrintDate

The date and time the document was submitted.

PrinterName

The name of the printer the document was printed on, this is usually the name of the printer on the client.

PrintFilePath

The PrintFilePath variable is available for compatibility with Print Distributor versions 3 through to 6.1. These versions always wrote the raw print stream to a file and the path to that file was available in this variable. Version 7 only writes very large streams to file to improve performance however if you use this variable then a temporary copy of the stream will be written to file and cleaned up afterwards.

Priority

The priority of the print document.

SerialNumber

A unique serial number that is incremented with every print document. This value starts at 1 and is stored in a 64-bit variable so won’t recycle until you have printed 9,223,372,036,854,775,807 documents.

Size

The size of the print stream in bytes.

TotalPages

The number of pages in the print document.

UserName

The name of the user that spooled the print document. In some circumstances this may be the account a service is running under.