The registry keys below comprise the SDK for pdfFactory. Some of the keys do not exist by default and should be created before they are used.
Setting the display mode
Note: Substitute “pdfFactory” for “pdfFactory Pro” if you do not have the Pro version installed.
HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro \PrinterDriverData\ShowDlg
HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro\PrinterDriverData\PdfAction
|1||n/a||show UI after spooling|
|2||0||do not show UI, do not email, do not view PDF file|
|2||1||do not show UI but view PDF file|
|2||2||do not show UI but put PDF file in an email|
|2||3||do not show UI but execute a program*|
This does not affect any open HDCs into the pdfFactory printer.
Note: the values above are of type DWORD, not string. The display can also be set interactively using the pdfFactory Preferences in the Windows Printers folder.
*Program name is placed in the PrinterDriverData section using the Exec key. %1 is the full pathame of the PDF file.
Display Mode Override
If for some reason the ShowDlg setting does not “stick”, “forced override” mode is available. For example, to set mode 2, PdfAction 1, set the following in the registry:
HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro\ShowDlg = 2
HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro\PdfAction = 1
Note: The forced override setting is the standard location for this setting without minus the “PrinterDriverData” subkey. In forced override mode, the setting affects ALL applications and it cannot be changed from the UI until you change it in the registry. so do not use this setting unless absolutely necessary.
Setting the filename
The output filename where the PDF will be saved can be set using these registry keys:
This only works for display mode 2 (shown above).
OutputFile is used once and then erased. When the OutputFile key is erased, it signals that the PDF has been created and can be acted upon by the calling application. If you want to print a sequence of files to pdffactory, here is the procedure in pseudeocode:
while (not done)
- set OutputFile to desired full path name
- print document to pdfFactory
- wait until OutputFile is cleared
OutputFilePerm is used every time, and is not erased after use. Existing files at the
destination with the same name are overwritten without prompting.
Setting the default path
Example: Here is a batch file that turns off the dialog box and uses OutputFilePerm to specify the name and location of PDF using pdfFactory. For pdfFactory Pro, substitute the appropriate key names.
To run this file, copy the lines below to a .bat file and execute it in a DOS command window. Note that PublishSettings is called to signal open applications to refresh their printer settings.
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory\PrinterDriverData” /v ShowDlg /t REG_DWORD /d 2 /f
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory4\PublishSettings” /v pdfFactory /t REG_DWORD /d 1 /f
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory4” /v OutputFilePerm /t REG_SZ /d “c:\MyFile.pdf” /f
echo Now start an application (e.g. Word, Wordpad, etc.) and print a
echo document to pdfFactory.
echo You will not get the pdfFactory dialog box, and your document will be
echo saved to c:\MyFile.pdf.
echo To return pdfFactory to normal behavior, just press any key.
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory\PrinterDriverData” /v ShowDlg /t REG_DWORD /d 0 /f
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory5\PublishSettings” /v pdfFactory /t REG_DWORD /d 1 /f
reg.exe delete “HKCU\Software\FinePrint Software\pdfFactory5” /v OutputFilePerm /f
Combining jobs into a single PDF
The CollectJobs registry setting is used to combine jobs when the dialog box is turned off .
HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro\CollectJobs
First set the output filename using OutputFilePerm. Set the CollectJobs value to the number of print jobs you want to combine. Each time pdfFactory receives a print job it decrements the counter. The counter value should be checked to ensure that it has been decremented before the next job is sent. When all the jobs have been collected and converted to PDF the counter is set to zero. Make sure you clear the OutputFilePerm key if normal operation should follow the job collection.
set OutputFile to desired full path name
set CollectJobs to desired number of jobs
while (Collectjobs != 0)
- print document to pdfFactory
- wait until CollectJobs is decremented
If the number of jobs to be combined is unknown, set CollectJobs to a large number. When all documents have finished printing, set CollectJobs to -1 (0xffffffff) and print another job (which will be ingored) to flush the jobs to a single PDF.
Execute a command line
pdfFactory can be set to execute a command when the PDF is ready. Set the command line in the pdfFactory Printing Preferences in the Windows Printers folder. Check the “Do not show dialog” and then select the “execute a command” option. An example command line is c:\myapp.exe %1 where %1 is the full pathname of the PDF.
pdfFactory Pro Email Settings
When you click on the “Send…” button in pdfFactory it creates an email message in your default email client with the Attachment field set to the name of the PDF file.
the newly created email message will be empty except for the Attachment field (i.e. no To, Cc, or Bcc recipients, no Subject, and no message body).
pdfFactory will create the message in your default email client but will not send it. You will need to explicitly send the message yourself when you are ready to do so.
In pdfFactory Pro, you can alter this behavior via the Email Settings dialog, or by setting registry values. To access the Email Settings dialog, click on the “Email” tab on pdfFactory Pro’s Settings tab. Email settings are stored in the registry:
HKCU\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro\Email.
Supported registry values are:
To (REG_SZ) – a list of intended recipients. The list items are separated by the standard Windows list separator (e.g. comma) as specified in the Control Panel International applet
Cc (REG_SZ) – a list of CC recipients. See the EmailTo section above for a description of the list format.
Bcc (REG_SZ) – a list of BCC recipients. See the EmailTo section above for a description of the list format.
Subject (REG_SZ) – subject of the email
Message (REG_SZ) – body of the email message. NOTE: you can use hard carriage returns and tabs in the message body, but in order to set those values in a registry string you must do it programmatically and not through REGEDIT. REGEDIT does not support those characters in a .REG file.
ViewMessage (REG_DWORD) – nonzero to view the message in the default email client before sending it. Zero causes the message to be sent immediately without viewing it. NOTE: the actual timing of when the message is sent depends on your email client. If you do not have your email client configured to send messages immediately, then the message generated by pdfFactory will go immediately into the Outbox but will not be sent until your email client actually transmits the messages queued up in the Outbox.
Here is a sample from REGEDIT which sets the To and Subject fields and the message body, and instructs the email client to send the message immediately:
[HKEY_CURRENT_USER\Software\FinePrint Software\pdfFactory5\FinePrinters\pdfFactory Pro\Email]
“Subject”=”here are the sales figures”
“Message”=”Hi guys, here are the latest numbers.”
Creating Page Tag variables
Page tag set components (headers, footers, watermarks) can be set using SYSTEM environment variables. In the Stamps tab, set the stamp string to <%env_var%> where env_var is the name of the SYSTEM environment variable. For example:
<%temp%> would display the system temp directory.