Add Reference To AxAcroPDFLib
Copy link to clipboard
Copied
I have found numerous examples online showing how to display a PDF in your program by using the AxAcroPDFLib assembly. However, I don't seem to be able to figure out how/where to access this assembly. In Visual Studio, I've tried to "Add Reference" and under "COM" it doesn't show the "Adobe PDF Reader" item that many online examples refer to.
I've tried adding a reference to the AcroPDF.DLL in:
C:\Program Files (x86)\Common Files\Adobe\Acrobat\Active X\
However, this does not supply a definition for the AxAcroPDFLib mentioned in the various examples. It supplies a reference to AcroPDFLib which in turn gives me the AcroPDF interface, which isn't recognized as a user control.
Installed on my system: Adobe Acrobat Pro DC, Adobe Acrobat Distiller DC, Adobe Reader X
I don't want to do anything too fancy. Just display a PDF within my forms window. But I'm completely lost at this point. Can anybody aim me in the right direction?
Copy link to clipboard
Copied
You are looking for "Adobe Acrobat Browser Control Type Library":
Copy link to clipboard
Copied
My project has a reference to "Adobe Acrobat Browser Control Type Library 1.0" already, but there appears to be no "AxAcroPDFLib"
Copy link to clipboard
Copied
The way how to add a "Ax*Lib" reference depends on the type of project.
On a 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".
I have never found an alternative way to add these types of references.
On a 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.

