Create a PDF doc with no possibility to print it
Hello,
It's possible to use the option PDFDisallowPrinting to get this (and UseAutosave option, and PDFUseSecurity...),
- But this work only if you are in the application of this doc (ex : word).
- This possibility doesn't work if you use it directly with the cPrintFile method....
The methods of security are not used by this way.
this code there doesn't work (you can print the doc....)
Do you have a solution, or is this problem will be solved in the next version ?
Thanks
code used :
-----------
sMasterPass = "master"
Set Obj_PDFCreator = CreateObject("PDFCreator.clsPDFCreator")
Call sSleep(100)
DoEvents
With Obj_PDFCreator
DoEvents
DefImp = .cDefaultPrinter
DoEvents
.cDefaultPrinter = "PDFCreator"
DoEvents
.cStart "/NoProcessingAtStartup"
Call sSleep(100)
DoEvents
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = App.Path
.cOption("AutosaveFilename") = NomDocPdf
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cOption("UseCreationdate") = vbNullString
.cOption("UseStandardAuthor") = 0
.cOption("PDFUseSecurity") = 1
.cOption("PDFOwnerPass") = 1
.cOption("PDFOwnerPassString") = sMasterPass
.cOption("PDFUserPass") = 0
.cOption("PDFUserPassString") = vbNullString
.cOption("PDFDisallowPrinting") = 1
.cOption("PDFDisallowCopy") = 1
.cOption("PDFDisallowModifyContents") = 1
.cOption("PDFDisallowModifyAnnotations") = 1
.cOption("PDFEncryptor") = 0
'Save Values
.cSaveOptions
End If
.cvisible = True
DoEvents
.cPrintFile Trim$(CheminFicSource & NomFicSource)
'Wait until the print job has entered the print queue
Do Until .cCountOfPrintjobs = 1
DoEvents
Loop
.cPrinterStop = False
'Wait until PDF creator is finished then release the objects
Do Until .cCountOfPrintjobs = 0
DoEvents
Loop
.cDefaultPrinter = DefImp
.cClearcache
.cClose
End With
Set Obj_PDFCreator = Nothing