Kristian D'Amato
Kristian D'Amato

Reputation: 4046

AcroPDF viewer control problems

I'm at the point of giving up.

I need to view pdfs in my Winforms application, so I've tried using Adobe's ActiveX control, and the vanilla WebBrowser control. The pdfs are local, and can be opened from Explorer with no problems at all.

The weird thing is that the application views the pdfs fine when running in Visual Studio, but the built application simply shows a grey area where the pdf is supposed to be. The exact same thing happens with both the Adobe control and the WebBrowser control. After a while, I usually get an Adobe error saying There is a problem with Adobe Acrobat/Reader. If it is running, please exit and try again. (103:103). I've looked this error up, which advised me to do things that didn't work (turning off a security setting).

Moreover, if the WebBrowser control is called with a .Navigate(path, true), the application opens an IE window that displays the pdf just fine.

I've tried running as administrator, which makes no difference. I'm at wits' end, so any help would be greatly appreciated. Maybe going for a 3rd party control?

Some further detail: I tried both Adobe 11 and Adobe DC, on Windows 10 and 8.1 VMs, .Net 4.6. Only a Win7 VM seems to work fine.

Upvotes: 1

Views: 2322

Answers (1)

Kristian D'Amato
Kristian D'Amato

Reputation: 4046

I solved this by building to x86 targets. Apparently AcroPDF.dll doesn't support x64. Of course, the error messages weren't at all helpful.

My previous answer was incorrect. The real issue is Adobe's Protected Startup mode. This has to be turned off for the application to use the viewer directly without problems.

Upvotes: 2

Related Questions