Go to CutePDF.com
   About Us  |   Contacts  
   
   
Overview
Developer Kit
Sample Code System Requirements License and Price

Developer Kit (PDF Writer with programmatic access)

Integrating free CutePDF Writer or Custom PDF Writer within your application is quite easy. You can print to the PDF Printer driver just as you would to any other printer. The registry keys below allow programmatic access to the display mode and filename.

Note: You need to create the following registry key in your application or manually first. Then set values under it.

The following settings work for free CutePDF Writer 4.0 and later.


Setting the display mode: 
HKEY_CURRENT_USER\Software\CutePDF Writer\BypassSaveAs 
(0 = show Save as dialog box after spooling, 1 = do not show Save as dialog box.) 
(This value is of type REG_SZ, not REG_DWORD)
 
Note: CutePDF Writer will set this value back to 0 after each PDF creation. The Custom PDF Writer won't.
 
Setting the filename:
HKEY_CURRENT_USER\Software\CutePDF Writer\OutputFile 
(Use the key above to set the output file for the PDF. A full pathname (e.g. d:\your folder\your file.pdf) is required.)
 

The following settings work for licensed Custom PDF Writer with programmatic access only.


Setting the display mode: 
HKEY_CURRENT_USER\Software\Custom PDF Printer\BypassSaveAs 
(0 = show Save as dialog box after spooling, 1 = do not show Save as dialog box.) 
(This value is of type REG_SZ, not REG_DWORD)

Setting the filename:
HKEY_CURRENT_USER\Software\Custom PDF Printer\OutputFile 
(Use the key above to set the output file for the PDF. A full pathname (e.g. d:\your folder\your file.pdf) is required.
 Also, you can use format specifier "%{n}d" in OutputFile to put each output in a separate file; for
 instance abc%d.pdf -> abc1.pdf, abc2.pdf ...; abc%03d.pdf -> abc001.pdf, abc002.pdf ... )
 
Setting the start number for the format specifier:
HKEY_CURRENT_USER\Software\Custom PDF Printer\StartAt
(This value is of type REG_DWORD.)
 
Setting the format of time stamp if use %TIMESTAMP% tag in the filename:
HKEY_CURRENT_USER\Software\Custom PDF Printer\TimeStamp
(This value is of type REG_SZ. Set string value -%Y-%m-%d-%H.%M.%S will get -2016-09-23-18.32.00)
 
Setting to use the print job title as the filename:
HKEY_CURRENT_USER\Software\Custom PDF Printer\UseJobTitle
(1 = use the print job title as the filename instead of using setting in OutputFile. The title has to be a full valid path.)
(This value is of type string (REG_SZ), not REG_DWORD)
 
The registry keys below allow programmatic email the created PDF file.
 
HKEY_CURRENT_USER\Software\Custom PDF Printer\EmailPDF
(1 = Email created PDF file.)
HKEY_CURRENT_USER\Software\Custom PDF Printer\EmailPDF_DIALOG
(1 = pop-up Email dialog box. 0 = send email immediately without confirmation. Default is 1.)
HKEY_CURRENT_USER\Software\Custom PDF Printer\EmailPDF_Subject
(Enter subject of your email here. Optional)
HKEY_CURRENT_USER\Software\Custom PDF Printer\EmailPDF_ToName
(Enter the name of your recipient here. Optional)
HKEY_CURRENT_USER\Software\Custom PDF Printer\EmailPDF_ToAddress
(Enter the email address of your recipient here.)
HKEY_CURRENT_USER\Software\Custom PDF Printer\EmailPDF_NoteText
(Enter the text body of your email here. Optional)
 
Note: the values above are all of type string (REG_SZ), not DWORD.
 
The registry keys below allow programmatic launch the created PDF file into an application (like Adobe Reader).
 
HKEY_CURRENT_USER\Software\Custom PDF Printer\ViewPDF
(1 = Launch the created PDF file in the application you set in EXE, or in default PDF viewer if you don't set EXE.)
HKEY_CURRENT_USER\Software\Custom PDF Printer\EXE
(Use the key above to set the application file for launching the PDF. e.g. "D:\Your App.exe" "%1")
 
Note: the values above are all of type string (REG_SZ), not DWORD.
 

Extension Module can be used to merge PDFs, add security, apply background, set document properties and margins.


Use the registry keys below to combining jobs into a single PDF file. Each time PDF Writer appends a job, it decrements the counter until 0. You can set the CombinePDFs value to the number of PDFs you want to merge.
 
HKEY_CURRENT_USER\Software\Custom PDF Printer\CombinePDFs
(0 = Existing files are overwritten, 1 (>1) = appended job at the end of existing file.) (This value is of type REG_DWORD.)
 
Use the registry keys below to combine with an existing PDF file.
 
Setting the PDF filename you want to add at the end:
HKEY_CURRENT_USER\Software\Custom PDF Printer\AppendFile
 
Setting the PDF filename you want to add at the beginning:
HKEY_CURRENT_USER\Software\Custom PDF Printer\PrependFile
 
Note: the values above are all of type string (REG_SZ).
 
Use the registry keys below to add security to your generated PDF document programmatically.
 
Setting the security:

HKEY_CURRENT_USER\Software\Custom PDF Printer\AddSecurity
(1 = create encrypted PDF file, 0 = do not add security to PDF file.)
 
HKEY_CURRENT_USER\Software\Custom PDF Printer\Level
(1 = 128-bit encryption, 0 = 40-bit encryption.)

Setting the passwords:
HKEY_CURRENT_USER\Software\Custom PDF Printer\userPassword
(Use the key above to set Password required to open document.)

HKEY_CURRENT_USER\Software\Custom PDF Printer\masterPassword
(Use the key above to set Password required to change permissions and passwords.)

Setting the permissions:
HKEY_CURRENT_USER\Software\Custom PDF Printer\noPrinting
(1 = prevent users from printing the file.)

HKEY_CURRENT_USER\Software\Custom PDF Printer\noModifyContents
(1 = prevent users from creating form fields, as well as making any other changes.)

HKEY_CURRENT_USER\Software\Custom PDF Printer\noModifyAnnotations
(1 = prevent users from adding or changing Comments or Form Fields.)

HKEY_CURRENT_USER\Software\Custom PDF Printer\noCopy
(1 = prevent users from copying text and graphics.)
 
Note:
the values above are all of type string (REG_SZ), not DWORD. 
 
You can use any single or 2-page PDF file (letterhead, pre-printed form, watermark etc) as a background and then print other content on top of it to create an overlaid PDF document. For 2-page background file, the second page will be used for all document pages other than the first.
 
Use the registry keys below to apply a background.
 
Setting the background:

HKEY_CURRENT_USER\Software\Custom PDF Printer\AddBackground
(1 = add background, 0 = do not apply background.)
 
Setting the source filename:

HKEY_CURRENT_USER\Software\Custom PDF Printer\BackgroundFile
(Use the key above to set a file for background. A full pathname is required. )
 
Setting the first page only option:
HKEY_CURRENT_USER\Software\Custom PDF Printer\FirstPageOnly
(1 = print background on the first page of the document only. 0 = repeated.)
 
Setting the overlay option:
HKEY_CURRENT_USER\Software\Custom PDF Printer\Overlay
(1 = background page is placed on top of all objects on page. 0 = Underlay. Default value is 0)
 
Note: the values above are all of type string (REG_SZ), not DWORD. 
 
The registry keys below allow programmatic set the properties of the generated PDF document.
 
   HKEY_CURRENT_USER\Software\Custom PDF Printer\Author
   HKEY_CURRENT_USER\Software\Custom PDF Printer\Title
   HKEY_CURRENT_USER\Software\Custom PDF Printer\Subject
   HKEY_CURRENT_USER\Software\Custom PDF Printer\Keywords
   HKEY_CURRENT_USER\Software\Custom PDF Printer\Creator
   HKEY_CURRENT_USER\Software\Custom PDF Printer\Producer

Note: the values above are all of type string (REG_SZ).
 
Use the registry keys below to set margins.
 
HKEY_CURRENT_USER\Software\Custom PDF Printer\LeftMargin
HKEY_CURRENT_USER\Software\Custom PDF Printer\TopMargin
HKEY_CURRENT_USER\Software\Custom PDF Printer\RightMargin
HKEY_CURRENT_USER\Software\Custom PDF Printer\BottomMargin
(The unit to use for margins is point. 1 inch = 72 point.)
 
HKEY_CURRENT_USER\Software\Custom PDF Printer\Scale
(0 = Actual Size, 1=Stretch, 2=Fit Scale. Default value is 2)
 
Note: the values above are all of type REG_DWORD.
 
 
Overview
Developer Kit
Sample Code System Requirements License and Price