Skip to main content

PDF and TIFF File Name Options

Print Wizard version 3.0 has the ability to produce PDF compatible files and as well as TIFF images of print jobs (ideal for faxing later or archiving).

However, running jobs automatically and through services can leave the job either overwriting or simply incrementing a sequence number (when "protect" is set) within the file name. These may not be very meaningful to the user and even less meaningful if they are going into some type of archiving system.

Fortunately we do have a few options that may be helpful. And in future releases we will be expanding on this and making it simpler to use.

How the defaults work

There are a set of default file names used within Print Wizard when generating output files from print jobs. These are set according to the following criteria:

A. Stand-alone from the command line

When you specify a file name on the command line to the, Print Wizard engine, Print Wizard is smart enough to utilize that file name, less the extension, to create the new PDF or TIFF file. An example of this would be:

"C:\Program Files\printwiz.exe mytestfile.txt /fpdf://"

This results in a file called mytestfile.pdf. You can also specify the file name within this string, including the full path of where to locate the new PDF file, by doing the following:

"C:\Program Files\printwiz.exe c:\temp\mytestfile.txt /fpdf://c:\archives\mytestfile.pdf"

The final location of these generated files will end up in the currently logged Print Wizard work directory. However, you can specify, through "print profiles" a different working directory for Print Wizard. If no permissions on granted to create a file in that location, the program may attempt to use the user's temporary Windows directory location.

B. From another application or script

Like the above, it is possible to execute the Print Wizard engine from another application and include all the necessary parameters as command line parameters. This would be similar to the above with one exception, the current application's or script's working directory is where the files will usually end up.

C. From a "despool" or "ftpdespool" service

A "despool" or "ftpdespool" service will utilize the actual file name dropped into the despool location to determine the actual PDF file name to generate, again, taking the file name and replacing the extension with ".PDF".

The big difference here is that the final directory where this file name will end up can be preset for a specific service. The service will need write permissions for this folder in order to place the new file there. If no output directory is specified for the service, the file will end up located in the starting directory of the service or in its current working directory.

D. From an "LPD" service

File names, as a standard, are also passed from the LPD service to the PC. However, when something prints to "standard-out" on the host end, there is no related file name. In this case, file names will end up coming from the LPD service with no name and we will prepend a default name to these, usually "Printwiz_Output", creating a TIFF or PDF file with this file name and the proper extension.

We create these files either in the output directory specified in the service setup, or in its current working directory.

E. From a "listen" service

File names coming from the "listen" or JetDirect® type protocol, contain no reference to a related file name. In this case, file names will end up coming from the listen service with no name and we will prepend a default name to these, usually "Printwiz_Output", creating a TIFF or PDF file with this file name and the proper extension.

We create these files either in the output directory specified in the service setup, or in its current working directory.

How to expand the file name

Custom file naming conventions are an easy way to separate one print job from another for archiving. These print jobs often come from applications or host system with identical names and this makes it hard to save them off or even distinguish one from the other when viewing or printing.

Print Wizard has a solution. An output file name for Print Wizard can contain one or more replacement variables that represent runtime data, rather than hard-coded file names. This file naming option can be utilized a number of different ways.

Below we discuss these various methods and then we follow it up with a table of variables available for file names.

A. Via a command-line parameter

When specifying a file name on the command line, you do so with the /F switch. Even when specifying the "superfile" file type, you can include this file name. With this file name, you can actually embed certain replacement variables that make it easier for you to preset specific items as part of the file name, such as date and time. You do this by wrapping these wildcard variables in curly-brackets and preceding it by a dollar-sign, such as

"C:\Program Files\printwiz.exe mytestfile.txt /fpdf://myfile_${PW_DATE}.pdf"

B. When running as a service

It gets a little more complicated if you want to specify these types of replacement variables when a service is generating a file. We currently do not have an easy way to set these for the service. However, it is still possible, and in fact, there are two ways to do this.

First approach: Custom Service

Services are setup and maintained through the Print Wizard user interface and the Tools menu. Services use the same Print Wizard engine described above for all their functionality, with one exception. From a service, you can set up a special type called a "Custom Service" that contains, in the service setup, a different "spawn" string to run when a service receives a print job.

By default, when this is blank, it runs Print Wizard with its defaults. But you can actually specify, in this string different Print Wizard parameters to use, including replacement variables for print-to strings, such as

c:\Program Files\printwiz.exe %1 /fpdf://myfile_${PW_DATE_YYMM}_${PW_TIME_HHM}.pdf

CustomSvc1

 

CustomSvc2

Second approach: Custom Profile

You can associate a Print Wizard print profile with a despool or listen service, and you can associate a Print Wizard print profile within any queue inside the LPD service. These profiles are used quite often to adjust print output and printer options beyond the defaults for the service.

But one additional use of print profiles is for a "custom" target, an application or script that is not the normal defaults of Print Wizard's engine. To set up a custom profile, you do this through the Print Wizard user interface and the Tools menu. You then have to associate that profile to a specific service or LPD queue in order for it to be used.

CustomProfile

CustomProfile2

Using this approach, you can set up a custom profile that emulates what normally happens with Print Wizard, but with added parameters.

When to use which approach

There is little difference in the two approaches for a listen or a despool service. The big advantage of a custom profile over a custom service is that several services can reference a single custom profile. So once it is working, you could reuse it easily for other services.

This is not the case with the LPD approach. In order to handle print queues and control records and headers coming from the host, you need to reference actual print queues and from each print queue you can then reference a custom profile. If you set up a custom LPD service, security and queue differences will be ignored and every print job will work the same.

The future

Our primary goal going forward is to make the idea of custom output file names more easily managed. The way it works now is cumbersome for just setting a file naming convention. We will be working toward simplification and more easily accessible defaults in the future.

Each service will still be able to be customized, but for something as simple as a file name convention, these will be able to be set by profile, by service or on a global scale for all Print Wizard jobs.

If you have specific needs in this area, please feel free to contact us with your ideas.

Expansion options

The table below lists the various available replacement variables that can be used with Print Wizard.

Please note that some of these may not make sense to use in certain situations and may indeed be empty. Please test thoroughly before putting these into use.

Variable   Description
PW_WINDIR   Where Windows is installed
PW_SYSDIR   Windows system directory
PW_CURDIR   Application's current working directory
PW_COMPUTERNAME   The computer's name
PW_MY_DOCS   User's document directory, "My Documents"
PW_COMMON_DOCS   Shared document directory
PW_DESKTOP   Windows desktop
PW_PROGRAM_FILES   Windows "Program Files" directory
PW_PROGRAM_DIR   Print Wizard's program directory
PW_APPDATA   User's application data working directory
PW_COMMON_APPDATA   Windows' application data working directory
PW_USERDATA   User's default data directory
PW_COMMON_USERDATA   Windows' default data directory
PW_DATE  

Windows current date. This can also specify portions of the date. Some examples might be as follows:

PW_DATE_YYYY
PW_DATE_YY
PW_DATE_MM
PW_DATE_DD
PW_DATE_YYMMDD

PW_TIME  

Specified Windows current time. This can also specify portions of the current time. Some examples might be as follows:

PW_TIME_HH
PW_TIME_MM
PW_TIME_HHMM

PW_DOCNAME   The passed document name
PW_DOCPATH   The path where the document originated from
PW_DOCEXT   The original document extension
PW_UNIQ_9999  

This represents a "uniquified" sequential number, whenever a file exists already, this will up the sequence number till it finds the next available file name to use. You can vary the length of the "9999" when specifying this option, such as

PW_UNIQ_99.

 

Conclusion

Print Wizard is set to utilize certain defaults when creating a file name and no file name is passed. It also utilizes defaults based on the file name being printed when one is provided.

With replacement variables included in the file name, Print Wizard will do certain substitutions of these variables for both path and file name.

This provides a very powerful feature for naming your files. And a reminder - always test thoroughly before implementing.

Copyright © 2021 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com