Skip to main content
February 4, 2019
Answered

Can't open PDF files from WinForms

  • February 4, 2019
  • 4 replies
  • 2903 views

Hello,

I'm trying to embed a local PDF file in a Windows Forms application; right now I'm using a standard WebBrowser control, which takes care of instantiating a web browser and, if Acrobat Reader DC is the default document handler for PDF files, the web browser calls it in order to display the contents of the file. The problem is, instead of getting the file displayed, I'm getting a "103:103" error. I have already tried disabling the "Enable Protected Mode at startup" and the "Allow documents to hide the menu bar, toolbars and window controls" options, with no luck. If I simply click on the same document from the filesystem, the application opens it correctly. Besides, I cannot ask all my end users to change their Acrobat Reader configuration. Any suggestions?

This topic has been closed for replies.
Correct answer

In that case, I think I'll just launch the default application for the PDF file format, looks like the safest choice to me. Thanks for your time, anyway.

4 replies

Legend
February 5, 2019

Or Acrobat, since Acrobat provides the same interface too, yes.

Correct answer
February 5, 2019

In that case, I think I'll just launch the default application for the PDF file format, looks like the safest choice to me. Thanks for your time, anyway.

Legend
February 5, 2019

In the Acrobat SDK. Most functions are for Acrobat only but there is one interface for Reader with OLE. Look in the “interapplication communication” section.

February 5, 2019

But in that case I would have to rely on the assumption that users have Acrobat Reader installed on their machines, right?

Legend
February 5, 2019

Hmm. If that works it means Reader is basically ok. Since your use is outside the expected use of Reader, I doubt you can proceed further with this. There is a supported API for PDF display in your window, see the SDK.

February 5, 2019

Can you be more specific? Where exactly should I look?

Legend
February 4, 2019

Are you able to view local PDF files embedded in local HTML using Internet Explorer?

February 5, 2019

Yes, Internet Explorer 11 correctly loads Acrobat Reader and displays the file.