pdfFactory Developer Kit

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\pdfFactory8\FinePrinters\pdfFactory Pro \PrinterDriverData\ShowDlg

HKCU\Software\FinePrint Software\pdfFactory8\FinePrinters\pdfFactory Pro\PrinterDriverData\PdfAction

ShowDlg PdfAction Description
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\pdfFactory8\FinePrinters\pdfFactory Pro\ShowDlg = 2

HKCU\Software\FinePrint Software\pdfFactory8\FinePrinters\pdfFactory Pro\PdfAction = 1

Note: The forced override setting is the standard location for this setting without 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:

HKCU\Software\FinePrint Software\pdfFactory8\OutputFile
HKCU\Software\FinePrint Software\pdfFactory8\OutputFilePerm

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

HKCU\Software\FinePrint Software\pdfFactory8\JobsDir
HKCU\Software\FinePrint Software\pdfFactory8\AutoSaveDir

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.

@echo off
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory8\FinePrinters\pdfFactory\PrinterDriverData” /v ShowDlg /t REG_DWORD /d 2 /f
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory8\PublishSettings” /v pdfFactory /t REG_DWORD /d 1 /f
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory8” /v OutputFilePerm /t REG_SZ /d “c:\MyFile.pdf” /f
cls
echo.
echo Now start an application (e.g. Word, Wordpad, etc.) and print a
echo document to pdfFactory.
echo.
echo You will not get the pdfFactory dialog box, and your document will be
echo saved to c:\MyFile.pdf.
echo.
echo To return pdfFactory to normal behavior, just press any key.
echo.
pause
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory8\FinePrinters\pdfFactory\PrinterDriverData” /v ShowDlg /t REG_DWORD /d 0 /f
reg.exe add “HKCU\Software\FinePrint Software\pdfFactory8\PublishSettings” /v pdfFactory /t REG_DWORD /d 1 /f
reg.exe delete “HKCU\Software\FinePrint Software\pdfFactory8” /v OutputFilePerm /f

Automatically Combining Print Jobs

When the pdfFactory dialog box is suppressed with the “Do not show dialog” checkbox in Printing Preferences, each print job sent to pdfFactory is converted to a separate PDF file. Print jobs are not combined.

Multiple print jobs can be combined into a single PDF file in unattended operation, however, using a registry setting:

key HKCU\Software\FinePrint Software\pdfFactory8 value CollectJobs (REG_DWORD)

The CollectJobs registry setting causes pdfFactory to hold all incoming print jobs until the specified number of jobs has been received, at which time a single PDF file containing all of the jobs is created.

The CollectJobs setting can be set either in regedit or by command line. For example, to collect 100 jobs in pdfFactory v8 the command would be

reg add “HKCU\Software\FinePrint Software\pdfFactory8” /v CollectJobs /t REG_DWORD /d 100 /f

If the number of print jobs is not known ahead of time then one of the following methods can be used.

Method 1: – set CollectJobs to a very large value, e.g. 100000 – print all jobs except the last one – before printing the last job, delete the CollectJobs registry setting – print the last job

With Method 1, when the last job is printed (and CollectJobs is not set), pdfFactory will add the last job to the previously deferred jobs, and then a single PDF file will be created from all the jobs.

Method 2: – set CollectJobs to a very large value, e.g. 100000 – print all jobs – set the CollectJobs registry setting to 0xffffffff – print a dummy print job (which will not be included in the PDF file)

With Method 2, the dummy print job causes pdfFactory to create a single PDF file from the previously deferred jobs. The dummy job is not included in the PDF file.

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\pdfFactory7\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\pdfFactory7\FinePrinters\pdfFactory Pro\Email]

“To”=”[email protected],[email protected]

“Subject”=”here are the sales figures”

“Message”=”Hi guys, here are the latest numbers.”

“ViewMessage”=dword:00000000

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.

Batch processing PDFs

In a batch environment, it is helpful to wrap the dispatcher command in a “start” command.
For synchronous operation, i.e. the batch file will wait until the file is done:
    start “” /wait “C:\Windows\System32\spool\drivers\x64\3\fppdis8.exe” file1 file2 …
For asynchronous operation, i.e. the batch file will continue to run:
    start “” “C:\Windows\System32\spool\drivers\x64\3\fppdis8.exe” file1 file2 …