2

I want to show a PDF file as a control within a WinForms window. I've seen a variety of references to AxAcroPDFlib which is (allegedly) a library that's part of Adobe's Reader app.

The problem I'm having is that despite having Acrobat Pro and Acrobat Reader DC and Adobe Reader X installed, I don't seem to have AxAcroPDFlib on my system.

In Visual Studio, within my project, I go to "Add Reference" and click on "COM Type Libraries", and it shows me a few different things for "Acrobat" but not the "Acrobat PDF Reader" I see mentioned in some online examples.

I can get a reference to AcroPDFLIb (without the "Ax" prefix) library and "AcroPDF" but that is just an interface. I can't add it to the form's collection of UI objects.

I'm lost... just looking for the shortest path to getting a PDF displayed in my window. Any ideas?

Mike Fulton
  • 920
  • 11
  • 22
  • Hi Mike, how about downloading the [Acrobat SDK](http://www.adobe.com/devnet/acrobat/overview.html). It even says in the docs, `You can also use IAC support to render a PDF file into an external application window instead of the Acrobat window.`. – Jesse Good Jan 20 '17 at 03:24
  • I *have* downloaded Acrobat SDK. So far it hasn't steered me in right direction. – Mike Fulton Jan 20 '17 at 17:27

1 Answers1

2

The way how to add a "Ax*Lib" reference depends on the type of project.

WinForms project:

  1. Just open any form class in the designer view
  2. Right-click on the toolbox and select "Choose Items..."
  3. Select "Adobe PDF Reader" under "COM Components" (if it is not there, then it is not properly registered in the Registry)
  4. Click "OK"
  5. Place the new toolbox item on the form

Now you automatically get the reference to "AxAcroPDFLib".

WPF project:

  1. Manually add a new WinForms form with the "New elements" dialog.
  2. Follow instructions 1-5 from above.
  3. Delete the WinForms form.

Now you have the reference and can use it inside a WindowsFormsHost control.

I have never found an alternative way to add these types of references.

Anateus
  • 439
  • 4
  • 13