Skip to content

anonymous /Convert2PDF.vbs secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Set fso = CreateObject("Scripting.FileSystemObject")
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") = fso.GetParentFolderName(WScript.Arguments(0))
.cOption("AutosaveFilename") = fso.GetBaseName(WScript.Arguments(0))
.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
Something went wrong with that request. Please try again.