Shortcuts

Download PDF Writer

Other Tools
Command line printing with Acrobat Wrapper

Awards & Press
PC Magazine

CHIP.de Online

CNet

ZD Net

XKnowledge

SnapFiles


Run a program after PDF creation

The three settings RunOnSuccess, RunOnError, and AfterPrintProgram can all run a custom program when the document creation process has finished.

The outcome of the process will influence which of the specified programs and command line arguments will be launched.

Common to all these settings is that they are accompanied by a couple of other settings that will modify their behavior. One of these settings will set the current directory of the executing process. Another will tell how the launched program will show up. It can run hidden, minimized or maximized.

Control Windows State and Current Directory

RunOnSuccess has the RunOnSuccessDir that specifies the current directory when launching the command line given in RunOnSuccess. It also has the RunOnSuccessMode setting, which will determine how the window state of the launched application will be. Both RunOnError and AfterPrintProgram have similar settings.

Specify the Full Path

When specifying the executable that is going to run it is a good idea to specify the full path of the executable surrounded by quotes. The full path is needed unless the system can find it using the PATH environment variable. Surrounding the full path by quotes makes it robust to path names containing spaces, which is quite common in names such as C:\Program Files.

32 Bit Context

Bear in mind that the specified command line is launched in a 32 bit context. This has no implications on which programs you can run on a 64 bit system. However, if you try to access a directory such as C:\Windows\System32 you will end up running a program in C:\Windows\SysWOW64. Accessing files in the C:\Windows\System32 folder on a 64 bit system requires that you use the file system redirector and specify C:\Windows\SysNative instead. For more information on this subject you should refer to the Microsoft documentation on file system redirection.