How to view PDF Documents using .Net 2.0 without Adobe Reader Installed.

Posted on 2008-11-12
Last Modified: 2012-05-05
We have a program that can view images of many types, some standard (JPEG, TIFF, etc) and some proprietary.  We would like to add the ability to view PDF documents as well.  As they select a new image, we select the correct viewer and view the image right in our application inside a WinForm (we set Visible = true for the correct viewer and Visible = false for the rest of them).  Therefore we would like to view PDF images inside our application (not launch Adobe Viewer).

I have been able to get this to work by including AxInterop.AcroPDFLib.dll and Interop.AcroPDFLib.dll and using an axAcroPDF1 viewer.

The problem is that all of the people who use this application do not need PDF documents and do not have Adobe Reader installed.  However if you try to run the newly built program that includes these Adobe dlls and Adobe is not installed, it crashes on startup ("has encountered a problem and needs to close"), even if they do not navigate to the screen that needs the pdf viewer.

Is there any way that we can only attempt to load the Adobe dll's dynamically if they attempt to view a PDF docuemnt so that those who do not have Adobe installed and do not view PDF documents do not need to install it?  Or alternately, is there a way we can include all of the required dll's with our program so that anyone can view PDF documents even if they do not have Adobe Reader installed.  We do not need a fully functional reader, just a simple viewer.

Question by:tjw_bld
    LVL 3

    Expert Comment

    by:Rupesh P
    Response.ContentType = "application/pdf";
     Response.WriteFile(whatever you need)
    LVL 44

    Accepted Solution

    You cannot include all the necessary DLLs in your program - the ActiveX control is just a method to remote control Acrobat (or Reader), and you need the application to be installed in order to do that. There are no DLLs or controls that you could include to implement that behavior.

    I'm not familiar enough with the .NET programming environment to recommend an approach that would load the ActiveX control only on demand, but you can certainly use another 3rd party control to render PDF documents. I would recommend the XPdf Viewer (

    Author Comment

    Thanks for the quick replies.

    Regarding rupshindia, I am not familiar with ASP.Net, but I think you giving a ASP.Net solution, where I need a WinForms solution.

    Regarding khkremer, the XPdf 3rd Party viewer is a possible option, although I'd still like to explore the dynamically loaded dll option.  I will accept your solution and open a new question.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    PaperPort is a popular document imaging/management product from Nuance Communications ( It is in widespread use by both individuals ( and businesses (http:/…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
    In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…

    761 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

    13 Experts available now in Live!

    Get 1:1 Help Now