Adding Adobe PDF viewer to a VB.Net Form

Posted on 2006-05-16
Last Modified: 2008-02-07
The app I would like to make contains a file tree on the left side of the form and when I drill down to a PDF file, the contents of that .pdf file show up on the right side of the form.  My question is; One: Is this possible? and Two: How would I go about doing this.  I am an intermediate VB programmer and have never done anything this complicated.  Is there a website I could go to to find an open source solution of an app like the one I want?  I saw the one question that somewhat talks about this subject, but really didn't understand the solution.
Question by:Heyitsjoe80
    LVL 1

    Expert Comment

    Well, I can tell you that I have searched the net left and right looking for an open source pdf reader and I had no such luck. I thought it was funny though, that were are a million examples of how to write a pdf and manipulate the pages in a pdf, but none that actually let you view the pdf. The closest thing I could find was an example on that makes a thumbnail of the text on the first page of the pdf file. The example was cryptic at best, so I didn't bother with it.

    As for non-open source solutions, there are a few components that render pdf files, but you have to pay for them. The only thing that is free (that I have found, and technically, it's not really free) is a COM component that Acrobat Reader installs. It is a viewer for pdf files, but requires that you have Acrobat Reader installed to use it.

    As I said, there are several open source projects that create them, but that's not what you want. I know because I am also looking for an open source solution to the pdf viewing problem. And this is one of those times I would like to be proven wrong when I say that there are no open source pdf viewing components that you can use in VB.NET or C#.
    LVL 8

    Expert Comment

    what I did was embedded pdf to my forms and controlled what toolbars, buttons showed... I did have to pay $99 one time from adobe sdk kit....If u pay $99 a yr u will get the updates every yr.... Also if this is for a program for ur company it is the only price u pay...Pretty nice the only bad thing is u  cannot utilize some of the other cool features unless the user has the full version of acrobat. For me I just wanted to embedd and lock down some things for users that had acrobat free reader.... Worked fine for me...Not sure for you...Just a thought..
    LVL 3

    Expert Comment

    Hi There,

    You can try utilizing a webBrowser control if the user only needs to view the pdf file. This solution also requires that the Acrobat reader is installed in client's computer.

    Drop a webBrowser control to your form. It is not in the toolbox by default so you'l have to right click the toolbox, select add/remove items, select COM components tab and scroll down until you find Microsoft Web Browser

    Then you can use a simple code like,


    webBrowser will act as a wrapper around PDF and display it on your form.

    Hope this helps.


    Author Comment

    Ok, Wildcard76, you answered my second question on Adobe.  Thanks, it's working great.  Now I need to create a file tree on the left so that the user can browse through a CD-Rom that has all the .pdf's.  When the user the finds the final they are looking for, I want them to click a View File button that displays the .pdf in the WebBrowser control.  That's my next leap and i'm having a hell of a time getting it to work.
    LVL 3

    Accepted Solution

    well there are two ways to do that...

    one hard one easy...

    on the hard way you can use a treeview control and populate the treeview object with node objects manually, by looking at the folder where the pdfs are... I'll need some time come up with an example...

    but you can use a folderbrowserdialog to pick the file...  just drag a folderbrowserdialog to your form, and use this code when the button is clicked

     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            OpenFileDialog1.InitialDirectory = "C:\temp"
            OpenFileDialog1.DefaultExt = ".PDF"
            OpenFileDialog1.Filter = "PDF files (*.pdf)|*.pdf|All files (*.*)|*.*"
            OpenFileDialog1.Title = "Please Select PDF File"
            If OpenFileDialog1.ShowDialog() = DialogResult.OK Then myBrowser.Navigate(OpenFileDialog1.FileName)
        End Sub
    LVL 3

    Expert Comment

    not a folderbrowser dialog, sorry...

    hope this helps



    Author Comment


    Thanks a lot.  The easy way works for now.  I'm also looking and working on some code to make the tree view.  The app would look better with the tree view instead of just a button.  But like you said, it's really the hard way.

    Expert Comment



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    Title # Comments Views Activity
    Update listbox from another thread 29 74
    Starting a WPF form via Reflection 8 26
    Help file 1 28
    Finding if Numbers are ranges 8 26
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now