Using Adobe ActiveX control

I have placed an ActiveX PDF control (the Adobe Reader OCX) on a .Net Windows form and set the .src property to the location of a PDF file on the internet. The control displays this file just fine when the application is run.

However, when I add a button to change the src file (to be displayed) with a
single line of code in the button click event as shown below:

AxPdf1.src = "http://www.somewebsite.com/somefile.pdf"

....I get the following error:

AccessViolationException was unhandled:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


Does anyone have any idea what the problem is here

Also, I want to be able to print the PDF file programatically without any user intervention. If I use the .print method it brings up the print dialog box & the user has to click OK. That's not what I want. I tried all the other print methods that are available, including .printall, but none of them do anything.
I have AdobeReader 6.0 installed & I am using VB2005 Express.
Thanks for any help...


Answer this question

Using Adobe ActiveX control

  • DonMartin

    You can find the printers using VBE. Then you can set the printer you want to be the default printer using script.
  • Kapoulkine Arseny

    I had a lot of trouble too with the Src property and printAll(). All those problems went away after I upgrade Adobe Reader to version 7.0.8. After four reboots (arrrghh), it updated acropdf.dll, the file now has a time stamp of May 16, 2006. printAll() works, so does the src property. Recommended.

    In case you haven't found it yet, the interface is documented here. It doesn't quite match the freeware ActiveX version but you'll have something to work with...


  • rocky_don

    The 'src' property is a string array, surprising that the statement compiles. When I try it, it just hangs and I have to kill to AcroRd32.exe process to keep going. Try using the LoadFile() method instead. Tried this with version 7 btw.

    With that version, the printAll() method doesn't generate the dialog, printWithDialog() does.


  • Glyn Darkin

    I looked for that before, didn't see it in the interface declarations. Sounds like you'll have to either use the default or display the dialog...


  • Sundararajan

    I am having the same problem but with Version 8. Anyone have any suggestions
  • karthik asok

    I get the exact same error with Abobe Reader 7.0 in an VB .Net application I am trying to build. I have tried both the .src and Loadfile methods. In fact if I remove the control from my project I do not get the error at all, as soon as I re added it the error comes back. I have tried just added the control and the commented out al the code that associated with the control in my code, then when I close my form I get the error on the dispose method for the form.
  • RookieDBA

    Upgrading to 7.0.8 resolves the above issues. Thanks for the tip...
  • SemiTransparent

    I have already tried the LoadFile, but that doesn't work for remote files, but it does work for local files. When you used PrintAll() did it actually send a print to your printer
  • rKarthik

    OK, I have another issue. How can I print to a specific printer All of the print methods of this control print to the default windows printer only. I need to be able to print to specific printers on our network. Anyone have any ideas on this one
  • Using Adobe ActiveX control