tags:

views:

51

answers:

1

I am trying to display a PDF in an Adobe PDF reader COM component in VB.NET.

All i do is:

   AxAcroPDF1.LoadFile("file path here")

But for some reason it's not displaying the PDF.

Can someone please advise me on what am I doing wrong here?

+1  A: 

You need to do a axAcroPDF1.Show()

According to the documentation you need a control for each new file you load, they aren't completely re-usable.

Benjamin Anderson
thanks for the reply. I did the .show as well but still it does not display the pdf. Please advise
Amit
Without seeing the rest of your code, I can't really provide much more help.Check the initialization of the control, and make sure the control is setup correctly in the WinForm.
Benjamin Anderson
I am able to view the pdf file by using the below code AxAcroPDF1.LoadFile(fileDialog.FileName)AxAcroPDF1.Show()But the problem is when i select any file other then PDF for example a JPG file then it shows an error which is fine but then if i try selecting another PDF file it never shows that. Please advise
Amit
Yeah, you'll have to create a new instance of the viewer. As stated the control isn't re-usable for some unknown reason.
Benjamin Anderson