KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: PDFCreator options
PRODUCT: 4D | VERSION: 13.0 | PLATFORM: Win
Published On: March 30, 2012

Starting with 4D v12, printing to a PDF on Windows was made possible by using the PDFCreator driver. Along with this, the SET PRINT OPTION command was also updated to support the PDFCreator driver options. The list of available options can be found within the PDFCreator software in a .ini file. Here is the path to the specific file:
   ..\PDFCreator\languages\english.ini

To illustrate some of the options and what they do, here is some sample code.

  //set main printing options
SET CURRENT PRINTER(PDFCreator Printer name)
SET PRINT OPTION(Destination option;3;"d:\\SalesDocument")

  //save settings
SET PRINT OPTION("PDFOptions:AutosaveFormat";0)
SET PRINT OPTION("PDFOptions:AutosaveFilename";"SalesDocument")
SET PRINT OPTION("PDFOptions:AutosaveDirectory";"d:\\")
SET PRINT OPTION("PDFOptions:UseAutosave";1)

  //document properties settings
SET PRINT OPTION("PDFOptions:StandardTitle";"August Sales Report")
SET PRINT OPTION("PDFOptions:StandardKeywords";"report sales margin profit august")
SET PRINT OPTION("PDFOptions:StandardSubject";"Combined sales report for August")
SET PRINT OPTION("PDFOptions:StandardAuthor";"John Smith")
SET PRINT OPTION("PDFOptions:UseStandardAuthor";1)

  //security settings
SET PRINT OPTION("PDFOptions:PDFUserPasswordString";"upass")
SET PRINT OPTION("PDFOptions:PDFUserPass";1)
SET PRINT OPTION("PDFOptions:PDFOwnerPasswordString";"opass")
SET PRINT OPTION("PDFOptions:PDFOwnerPass";1)
SET PRINT OPTION("PDFOptions:PDFLowEncryption";1)
SET PRINT OPTION("PDFOptions:PDFUseSecurity";1)

 //user limiting settings
SET PRINT OPTION("PDFOptions:PDFDisallowCopy";1)
SET PRINT OPTION("PDFOptions:PDFDisallowModifyAnnotations";1)
SET PRINT OPTION("PDFOptions:PDFDisallowModifyContents";1)
SET PRINT OPTION("PDFOptions:PDFDisallowPrinting";1)

  //actual printing code
ALL RECORDS(...)
FORM SET OUTPUT(...)
PRINT SELECTION(...)
SET PRINT OPTION("PDFInfo:Reset standard options";0)


This code will generate a PDF document that, among other things, will: be password protected, disable certain features when someone logs in with a "user" password, and will have certain document properties set. Here is an example of some of the document properties that are set.