Knowledgebase: Developer
Detecting when Win2PDF has finished
Posted by admin admin on 22 November 2006 09:27 PM

Problem:
Is there a way in which we could tell when Win2PDF has finished printing?

Solution:
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
Do
Sleep 10
PDFRegKey = GetSetting("Dane Prairie Systems", "Win2PDF", "PDFPostFileName", "")
Loop While PDFRegKey <> Empty
(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Copyright 2000-2015 © Dane Prairie Systems LLC. All Rights Reserved. About Us | Privacy Policy | PDF Blog | Site Map