Skip to main content
Participant
January 12, 2007
Question

Show PDF File in Windows Form using Visual Basic 2005

  • January 12, 2007
  • 39 replies
  • 26790 views
Hello.

I am a developer beginner in acrobat products.

I'm developing an application and I need to open one pdf file in one form with various controls, such as Text Boxes and so on, using visual basic 2005. I try to insert the Acrobat control in that form and it not works. What do I need to do to make this possible.

My configuration.

Windows XP Pro.
Visual Studio 2005 Pro.
Acrobat 7 Professional.

In the client computer I have to install Acrobat 7 Professional or I need only the Acrobat Reader?

Thanks.

Fernando Silva.

39 replies

Participant
May 29, 2007
Thanks, Michael. Yes, it is a typo. I have Visual Studio 2005 and Adobe Reader 7.0. I go through the steps you mensioned with VB and C# both. I added the control called "Adobe PDF Reader" in stead of "Adobe Acrobat 7.0 Browser Control Type Library 1.0" which I saw it when I add a reference to project. When I call LoadFile, it returns false. I don't know how to get the error message from this. This file is there. I don't have Adobe SDK. Do I need to have SDK to make it work?
Participant
May 28, 2007
Yes, it should work the same way. I'm not sure the format is identical.
what is the error message : no such file, or the command is bad?

you have a typo in your message
axAcroPFD1.LoadFile / should be:
axAcroPDF1.LoadFile

you could also print out the file name within your program, to make sure it is ok.
Participant
May 27, 2007
I want to do the same thing in C# with Microsoft studio 2005. Just want to open a pdf file and display it into a window form. I have installed Adobe Reader 7.0 and did the same steps as Michael mensioned. When I call axAcroPFD1.LoadFile(my-pdf-file), it failed. The file is there. Could someone helps me to see what is wrong? Do I have to install Acrobat SDK? Do I have to have a license to do this? Thanks!!
Participating Frequently
February 1, 2007
and to ensure that users have the latest/correct version of Reader.

Leonard
Participant
January 31, 2007
I'm not sure I follow the argument for the need of a license.
Why would anyone distribute Adobe Reader? I assume any user machines will correctly obtain their own copy of the free Reader.

If my program calls Reader resources, do I need a license to send my program (but not Reader) to others?

If so, sending anyone a pdf file would seem to require the same license.
Participating Frequently
January 31, 2007
No, you only need a license to redistribute Reader. More people want
to do this than you might think, e.g. to include it on a CDROM with a
PDF document.

Aandi Inston
Participating Frequently
January 26, 2007
You can't distribute JUST the DLL's - you would need to distribute the entire Adobe Reader.

And yes, for that, you would need a license.

Leonard
Participant
January 26, 2007
Do we need a license from Adobe to redistribute the DLLs referenced when a COM object is used in the above manner mentioned by Michael?
Participant
January 16, 2007
It should be possible to use the free Reader, if you only want to display and print pdf files.

I have been using the Adobe Acrobat ActiveX (COM) with VB.
(Menu: Project / Add Reference / COM tab / select "Adobe Acrobat 7.0 Browser Control Type Library 1.0" ). You then drag it from the Toolbox to your form. You then have access to code commands to size it, make it visible (or not) and to Load pdf files. You can display the file within a window on your form (Load).

Once you have pdf filename, you should be able to display it using only 2 commands :
AcroPDF1.Visible = True
fileNameX = "C:\subdir\Myfile-x.pdf"
AcroPDF1.LoadFile fileNameX
Participating Frequently
January 12, 2007
The Acrobat SDK describes which interfaces require Acrobat, and which
ones work in Reader. Most require Acrobat. Check especially the IAC
Overview, "Differences among the Acrobat viewers" in each section.

Aandi Inston