PDF printing does not generate events in my app. + windows 7

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
charuVas1
Posts: 8
Joined: Thu Jun 19 2008

PDF printing does not generate events in my app. + windows 7

Post by charuVas1 »

Hi,

I am using PDF Converter 4.0 Activex Control and having windows 7 OS. I had created a printer "Docsvault". when I print on my printer,I do not get the event generation in my application.
Below is sample code in vb.net . where I set the CaptureEvents true and broadcast message &H20 in filenameoption. My document start and end event is also not fire.

when I print on my printer trial period of amyni comes and then job is printing on printer but i do not get the event fire in my application.

Public WithEvents cdi As CDIntfEx.CDIntfExClass = New CDIntfEx.CDIntfExClass

Sub main()
cdi.PDFDriverInit("Docsvault")

cdi.EnablePrinter("PDF Converter Evaluation License", "07EFCDAB010001001AA3FF4D90FB671BDCDDD8BF0AC74218D74458FE7710A69CEADC21434066BC02C587E533BE120767F53E2ACCD4474A0E901127948CE758")

cdi.SetDefaultPrinter()
cdi.CaptureEvents(True)
cdi.FileNameOptionsEx = &H1 + &H2 + &H80 + &H10 + &H20
cdi.DefaultFileName = System.IO.Path.GetTempPath & "abc.pdf"

AddHandler cdi.EnabledPre, AddressOf EnablePre_Function
AddHandler cdi.EndDocPost, AddressOf EndDocPost_Function
AddHandler cdi.StartDocPost, AddressOf StartDocPost_Function

end sub

Private Sub EnablePre_Function()
cdi.EnablePrinter("PDF Converter Evaluation License", "07EFCDAB010001001AA3FF4D90FB671BDCDDD8BF0AC74218D74458FE7710A69CEADC21434066BC02C587E533BE120767F53E2ACCD4474A0E901127948CE758")

End Sub

Private Sub StartDocPost_Function(ByVal JobID As Integer, ByVal hDC As Integer)
msgbox "start doc"
end sub

Private Sub EndDocPost_Function(ByVal JobID As Integer, ByVal hDC As Integer)
msgbox "end doc"
end sub
charuVas1
Posts: 8
Joined: Thu Jun 19 2008

Re: PDF printing does not generate events in my app. + windows 7

Post by charuVas1 »

Hi,

I again tested this code on windows XP machine. It works fine it fire the EnabledPre event in my application. so now issue is with the Winodws 7.

If any one knows then please guide me in this matter.
thanks in advance.
pdfuser
Posts: 7
Joined: Tue Mar 01 2011

Re: PDF printing does not generate events in my app. + windows 7

Post by pdfuser »

Any information on this problem? I am seeing the same thing on Windows 7.
The only event I ever get is the Enable Printer event.
pdfuser
Posts: 7
Joined: Tue Mar 01 2011

Re: PDF printing does not generate events in my app. + windows 7

Post by pdfuser »

Okay, I found the solution to my problem with not getting events.
Ensure that you specify the BroadcastMessages option when setting the FileNameOptions property and make sure the values are in HEX.

I missed the part about the values being in hex, and when specified as decimal, the events will not occur.
Post Reply