Link to home
Start Free TrialLog in
Avatar of misha051797
misha051797

asked on

Viewing Adobe reader PDF files

Greetings,

Is there a solution for viewing the PDF file from VB. If yes what should be done in order to achive that.
Thanks
Avatar of idcanada
idcanada


Insert an OLE object onto your form and add the PDF or prompt
for a PDF file.

Their is no other way possible at the current momment.
However,
you might want to check Activex.com for a control that could view
these files. Of course, I do imagine that it would not come
cheap.

Best of luck.
As far as I know PDF in not an OLE Document. BTW you must have installed some PDF application in that case to view it.
A better suggestion is to download the free PDF ocx from the adobe site. This one you can add to the form to view your pdf file. I can't answer the question since it is locked by idcanada
idcanada is wrong. There *IS* an OCX for Adobe. Mirkwood is right. It's easy to just, it's a complete Reader in one control. All you have to do is set the file name and the control does the rest.

M

Avatar of misha051797

ASKER

mark2150, the activex control i have downloaded is insertable in the vb application. I was able to set scr property to the pdf file i would like to view. And it did open my file. But when I wanted to load another file I used PDF1.LoadFile("d:\mypdf.pdf") and the Adobe Reader will respond "An Internal error has occured". Since the ActiveX control designed specifically for the WEB i tried to use strings like "file//d:\mypdf.pdf", but no luck. Therefore I think that it is not working.
Have you tried other PDF files as well? Maybe the one you tried is corrupted or contains something weird./
idcanada thank you,
the problem is that adobe is not very open about the ADOBE READER ole stuff. i tried to reference pdf.tlb file and then i placed the ole control (-> adobe document) on my form. i do not think what you have suggessted above will work.

Alternative might be to use the webbrowser control. Make the webbrowser control open the PDF file and start the plug-in.
Another option is to launch the PDF viewer and use setparent to make your window the owner.
ASKER CERTIFIED SOLUTION
Avatar of Mirkwood
Mirkwood

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BTW: You have to use the src property iso loadfile and it does not work within VB. You have to compile and run the exe before it works.
great, thanks