Skip to content

Instantly share code, notes, and snippets.

/convert2PDF.vbs Secret

Created July 19, 2013 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b8cc0e5c6bc316b3ccd1 to your computer and use it in GitHub Desktop.
Save anonymous/b8cc0e5c6bc316b3ccd1 to your computer and use it in GitHub Desktop.
Set PDFCreator = Wscript.CreateObject("PDFCreator.clsPDFCreator", "PDFCreator_")
With PDFCreator
ReadyState = 0
.cStart "/NoProcessingAtStartup"
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveFormat") = 0
.cOption("AutosaveStartStandardProgram") = 0
DefaultPrinter = .cDefaultprinter
.cDefaultprinter = "PDFCreator"
.cClearcache
.cPrinterStop = false
.cOption("AutosaveDirectory") = WScript.Arguments(1)
.cOption("AutosaveFilename") = WScript.Arguments(2)
.cPrintfile cStr(WScript.Arguments(0))
c = 0
Do While (ReadyState = 0) and (c < 120)
c = c + 1
Wscript.Sleep 250
Loop
.cDefaultprinter = DefaultPrinter
.cClearcache
WScript.Sleep 200
.cClose
End With
Public Sub PDFCreator_eReady()
ReadyState = 1
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment