Please enable JavaScript to view this site.

PDF Image Printer

Navigation: PDF Image Printer Advanced Concepts

Using Environment Variables and Registry Keys

Scroll Prev Top Next More

Environment variables and registry key values can be used to supply custom information to the printer profiles and script file at the time of printing. This technique is often used when automating printing or creating custom printer setups. The following settings in the conversion profiles can use this feature:

the Output Folder Location and Base File Name on the Save Options and Filename Creator settings

any image path when an image is included as a stamp from Stamping

paths and parameters from the Run Commands

paths to the error log and support files from Support Options

In the printer script file, environment variables and registry key values can be set in the Save and Run Commands sections.

Environment Variables

Environment variables are specified using the syntax %VARIABLE%, such as C:\Output\%USERNAME%, or %USERPROFILE%\Output. You can also create and use your own system or user environment variables.

Here, the well-known environment variable, %USERPROFILE% is used to set the output location to a folder named PeernetOutput in each users Documents folder.

This resolves to C:\Users\user\Documents\Converted, where user is replaced by the name of the current logged in user.

UsingEnvironmentVariables

 

Custom environment variables can also be. Here the environment variable, %ArchiveOutputFolderName% has been created and set to the folder name PEERNETOutput.

AddingCustomEnvironmentVariables

 

It can now be used to set the name of the output folder, which would resolve to C:\Users\user\Documents\PEERNETOutput, where user is replaced by the name of the current logged in user.

UsingCustomEnvironmentVariables

Registry Keys

Registry keys expand in the same way as environment variables. They are designated using a special syntax, $[registry key], where registry key is replaced by the complete path to a valid registry key value that you want to use. This value stored in the registry can be a complete path, or a single piece of information.

AddingRegistryKeys

 

The complete path to a valid registry key value must appear inside the square brackets, including the value name as the last item.

UsingRegistryKeys

 

Registry keys can be any information you need to inject into a path or run command, or run command parameters. Here, the key, $[HKEY_LOCAL_MACHINE\SOFTWARE\Company Inc\ProductFolderName] contains only a string, the name we want to use as part of the output folder path.

AddingRegistryKeyPiece

 

Combining this with the environment variable %USERPROFILE% we can build the path from dynamic information at runtime.

UsingRegistryKeyPiece