I have an Add-in which prints to PDF and sets the filename according to a set of rules chosen by the user.
This has been rolled out across the company to about 50 workstations. We use Adobe Acrobat XI Pro as our PDF printer.
The problem I am having is that sometimes the Add-in will hang but it is unpredictable as to when this will happen, making it hard to find a solution.
A solution when this happens is to use task manager to kill the acrotray.exe process which then lets the Add-in continue successfully.
I have tried several ways of printing from the API, without improvement. I have a loop after the submit print code to allow the first print to be sent before moving on to the next.
I open the views first then select them one at a time to make that the active view then submit the active view to the print manager.
My code at the moment looks like this:
'print the active view
MyPrintMgr.SubmitPrint()
'wait until file is created before proceeding
Dim count As Integer = 0
Do Until File.Exists(FileName)
If count = 60 Then 'change this value to adjust timeout
Exit Do 'prevent being stuck in loop for ever
End If
Threading.Thread.Sleep(1000) 'wait 1 second
count = count + 1
Loop
End If
Any ideas?