Click here to Skip to main content
15,844,498 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been using the Adobe AXAcroPDFLib control in my WinForms apps for several years. It works pretty good most of the time, however, one of the biggest drawbacks is that each user had to enable the Adobe reader Addon in Internet Explorer to get it to work otherwise the user would get a COM error. It wasn't a huge deal, however, because it only had to be done once on every computer but after that things worked fine.

Unfortunately now, things have changed after Microsoft killed Internet Explorer. Even though we were using MS Edge or Chrome, we could still launch IE 11, make the addon change and the app would work. This process worked fine up to a couple of months ago. Now IE 11 no longer opens but instead open MS Edge so there is no way to enable this addon any more. The app continues to run fine on existing computers but we no longer have a way to get it run on new computers that never had the addon enabled.

What I have tried:

I found this article online that mentions that mentions that MS Edge doesn't support the control but it did say I could possibly use Chrome by changing some settings but that didn't work as I still get the same COM error:[^]

What other options do I have? Do I have to find some other control to use or is another way to get the Adobe control to work?
Updated 15-Nov-23 7:43am

You cannot use the COM library anymore. Period.

COM functionality in browsers was found to be a major security risk over a decade ago and the industry has been working on removing all support for it in the browsers.

What you use in its place depends on what you were doing with the library. Just to show a PDF is easy as browsers now support that natively. Most even support fillable PDFs and the user can save the filled in version of the PDF locally.
Share this answer
You have 2 options to still use your control without enabling it in a web browser, both requires you to change your app to interact with the control though, not sure if this an available option to you -

1) In your Visual Studio project, right-click on the project in Solution Explorer.
Choose "Add" -> "Reference..."
Go to the "COM" tab, and look for "Adobe PDF Reader" or similar.
Add the reference 'AXAcroPDFLib' to your project.
Open your WinForms designer.
Find the 'AxAcroPDFLib.AxAcroPDF' control in your toolbox.
Drag and drop it onto your form.
In your form's code, initialize the control.
You might do this in your form's constructor or load event, code will look similar to -

Imports AxAcroPDFLib

Public Class YourForm
    Private pdfViewer As AxAcroPDFLib.AxAcroPDF

    Public Sub New()
    End Sub

    Private Sub InitializePdfViewer()
        pdfViewer = New AxAcroPDFLib.AxAcroPDF()
        CType((pdfViewer), System.ComponentModel.ISupportInitialize).BeginInit()
        pdfViewer.Enabled = True
        pdfViewer.Location = New System.Drawing.Point(10, 10) 'Set the desired location where you want to show the control...
        pdfViewer.Name = "pdfViewer"
        pdfViewer.OcxState = Nothing
        pdfViewer.Size = New System.Drawing.Size(800, 600) 'Set the desired size of display...
        pdfViewer.TabIndex = 0

        CType((pdfViewer), System.ComponentModel.ISupportInitialize).EndInit()
    End Sub

    Private Sub LoadPdf(filePath As String)
        If System.IO.File.Exists(filePath) Then
            MessageBox.Show("File not found.")
        End If
    End Sub
End Class

2) To use the 'Adobe AXAcroPDFLib' control in a web browser, you will have to embed it within an HTML page. You must utilize an 'object' tag with the appropriate 'classid' for the Acrobat Reader control -

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Open the PDF in my browser</title>

<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" 
    <param name="src" value="your_pdf_file.pdf"> <!--Use the path to your file here...-->
    <param name="type" value="application/pdf">
    <embed src="your_pdf_file.pdf" type="application/pdf" width="800" height="600">
        <!--Add alternative content here for non-supported browsers... -->
        <p>PDF viewer not supported. Download the PDF to view it.</p>


HTML code will embed the Adobe Acrobat Reader control into a users browser and attempt to display the specified PDF file. Users without the Acrobat Reader plugin may see an alternative content.

Keep in mind that embedding specific plugins in a users web page can have compatibility and security implications and issues. Maybe think about using alternative approaches such as using a 'PDF.js' library for a more browser-neutral solution - A general-purpose, web standards-based platform for parsing and rendering PDFs[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900