-
-
Save anonymous/f6b3aaa21c8a02b7242e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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