HoustonGSC
IS-IT--Management
I don't see many examples of invoking Distiller via VBS however, I did find enough examples on the web to get one working.
The problem I am having is trying to figure out how to capture the events indicated in the Acrobat® Distiller® API Reference
OnJobStart
OnJobDone
OnJobFail
OnLogMessage
OnPercentDone
OnPageNumber
Without all the error checking and other stuff, this is the basic gist of my script. Hopefully someone can lend a hand with this.
Set oAcroDist = Wscript.CreateObject("PDFDistiller.PDFDistiller.1", "Acro_")
strPDFOptions = WScript.Arguments(0)
strInputPostScript = WScript.Arguments(1)
strOutputPDF = WScript.Arguments(2)
'**************************
' Get Options file
'**************************
Set OptObjFile = fs.GetFile(strPDFOptions)
'**************************
' Get input file
'**************************
Set InpObjFile = fs.GetFile(strInputPostScript)
'**************************
' Invoke Distiller
'**************************
oAcroDist.bShowWindow = False
oAcroDist.bSpoolJobs = False
oAcroDist.FileToPdf strInputPostScript, strOutputPDF, strPDFOptions
Sub AcrnJobFail
ObjLogFile.Writeline Now() & " : " & "Postscript conversion to PDF encountered an error"
Wscript.Quit 12
End Sub
The problem I am having is trying to figure out how to capture the events indicated in the Acrobat® Distiller® API Reference
OnJobStart
OnJobDone
OnJobFail
OnLogMessage
OnPercentDone
OnPageNumber
Without all the error checking and other stuff, this is the basic gist of my script. Hopefully someone can lend a hand with this.
Set oAcroDist = Wscript.CreateObject("PDFDistiller.PDFDistiller.1", "Acro_")
strPDFOptions = WScript.Arguments(0)
strInputPostScript = WScript.Arguments(1)
strOutputPDF = WScript.Arguments(2)
'**************************
' Get Options file
'**************************
Set OptObjFile = fs.GetFile(strPDFOptions)
'**************************
' Get input file
'**************************
Set InpObjFile = fs.GetFile(strInputPostScript)
'**************************
' Invoke Distiller
'**************************
oAcroDist.bShowWindow = False
oAcroDist.bSpoolJobs = False
oAcroDist.FileToPdf strInputPostScript, strOutputPDF, strPDFOptions
Sub AcrnJobFail
ObjLogFile.Writeline Now() & " : " & "Postscript conversion to PDF encountered an error"
Wscript.Quit 12
End Sub