Is there a way in which we could tell when Win2PDF has finished printing?
If you use the PDFPostFileName registry setting to specify the file name instead of PDFFileName, you can check for the existance of the registry value to determine when Win2PDF has completed processing the PDF file. PDFPostFileName works just like PDFFileName, but the value isn't deleted until processing has been completed. A VB example showing how to poll for the existance of PDFPostFileName after printing to the Win2PDF printer is below.
Under general declarations:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'set file name in registry
SaveSetting "Dane Prairie Systems", "Win2PDF", "PDFPostFileName", "c:\\customer_number.pdf"
'print to Win2PDF
'Verify Win2PDF is done creating PDF file
PDFRegKey = GetSetting("Dane Prairie Systems", "Win2PDF", "PDFPostFileName", "")
Loop While PDFRegKey <> Empty