Write File

Note: Print Distributor has now been discontinued.

The Write File Action allows you to redirect your raw print directly to a file for archiving or post processing. The format of the file you write will depend on the type of printer driver you selected, the file extension does not change the format of the file.

By default you will have a path of C:\Archive\?? serialnumber ??.prn, this means any jobs will be written to the folder C:\Archive and with an extension of .prn. The ?? serialnumber ?? is a bit of Print Distributor magic which gets converted into a unique serial number for each print job. Some printer drivers may use .xps or .pdf for the default file extension if that is the format for the printer driver selected.

Write File Properties

The Mode property lets you control whether existing files are overwritten or appended to.

The Retry property lets you set a retry interval and number of retries. This is most useful if you are writing to a network path where the connection might not be reliable. It’s less useful for local paths as the most likely point of failure is lack of disk space which won’t be fixed without intervention.

Note: Network Drives when running as a Windows service

Although you can enter a mapped drive for the path when Print Distributor tries to write to it it won’t be able to because mapped drivers are associated with a user login so aren’t available to the Print Distributor service. If you need to write to a network path then use a UNC path in the format \\ServerName\ShareName\FileName, you will also need to run the Print Distributor service under an account that has rights to the path or move the Write File action under a Run As action.

Note: Overwritten Jobs

If you don’t include a serial number then there is a risk that a new print job will overwrite a previous job, even if you include the time in seconds or the job id, these fields aren’t guaranteed to be unique but the serial number is.