I'm doing some AutoVue ActiveX with VB.Net 2008. This issue that I'm having is that it only prints once and won't invoke the printIt() method again. But if I restart the coding session, the printIt() will work the first time only.
The code is in a function that gets called from a menu button and the FilePath has the file path and drawing name ( a DWG file) within it.
avPrintDrawing.setFile("upload://" & FilePath)
avPrintDrawing.setPrintOptions("PRINTDRIVER", "CutePDF Writer")
I have tried .closeDocuement() but that doesn't help. Is there a method I need to do to refresh the settings. or does it need some sort of init again?
One thing i noticed that could cause the problem is that you would need to listern for EVENTID_FILEEVENT_ONSETFILE after calling setFile() to ensure the file is completed loading before calling printIt(). So in your code the button should call setFile() and you need another function to handle EVENTID_FILEEVENT_ONSETFILE (please see the sample VB application ship with the product - AxJVueAXControl1_onFileEvent function) and call printIt() from there.
Hope this help
One thing i noticed that could cause the problem is that you need to wait for the file completed loading before calling printIt(). You may look at the VB sample shipped with the product and search for function AxJVueAXControl1_onFileEvent that handles the ONSETFILE event. In your code the button should call setFile() and in an function handles ONSETFILE event and call printIt() from there.
Hope this help,
Hi and Thanks for the suggestion on looking for the ONSETFILE.
I've looked at the example and have a question whether I wait for the EVENTID_FILEEVENT_ONSETFILE or the EVENTID_FILEEVENT_ONSETTINGFILE.
It seems that EVENTID_FILEEVENT_ONSETTINGFILE is shown after the EVENTID_FILEEVENT_ONSETFILE when I output the debug.
do you have an extened example of a working sub heading? here is mine.
Private Sub avPrintDrawing_onFileEvent(ByVal sender As System.Object, ByVal e As AxJVueAXLib.IID_ISource_onFileEventEvent) Handles avPrintDrawing.onFileEvent