I had a macro that used distiller to create a PDF, which worked fine. I converted the macro to an addin and now am having issues with it. It creates a postscript file and then creates the PDF on first run ok. The next time I use it, it fails because the distiller process is still running.
I read some info that you need to add the distiller object to its own class and then dispose of it. That's where I'm lost as to how to do this? Anyone have any instructions on how to go about doing this? I'm using VB Express 2005.
Basic code:
myPDF = New ACRODISTXLib.PdfDistiller
And then:
' Submit the print.
Dim myPSS As String
myPSS = (txtFolderPath.Text & ("\" & oDocName & oDocNameSuffix & ".ps"))
oPrintMgr.PrintToFile(myPSS)
' Create the PDF
myPDF.FileToPDF(myPSS, (txtFolderPath.Text & "\" & oDocName & oDocNameSuffix & ".pdf"), "")