Skip to main content
Participant
April 27, 2016
Question

AcroPDFLib.IAcroAXDocShim.LoadFile(String fileName), Error HRESULT E_FAIL has been returned from a call to a COM component.

  • April 27, 2016
  • 1 reply
  • 5717 views

I'm getting an exception occasionally when loading a PDF in C# code.

This is the information:

Source: Interop.AcroPDFLib

Message: Error HRESULT E_FAIL has been returned from a call to a COM component.

Stack Trace: at AcroPDFLib.IAcroAXDocShim.LoadFile(String fileName)

at AxAcroPDFLib.AxAcroPDF.LoadFile(String fileName)

This is the line of code throwing the exception: m_axAcroPDF.LoadFile(m_fileName);

The file is located on the network, but when I view the files, they are opening fine.

Does anyone know what could be causing this error or workarounds so that I can re-attempt to load the PDF again automatically without the exception?

Thanks for the help in advance!

This topic has been closed for replies.

1 reply

lrosenth
Adobe Employee
Adobe Employee
April 28, 2016

We need a LOT more information here...

- Acrobat or Reader installed?

- What version?

- You say this is in C# code - but in what environment?  App? Browser? other?

- What do you mean that "the file is located on a network"?   Over HTTP?  SMB?  Other?

- What information is included in the exception?  Your catching it will give you error #'s and messages. What are they?

Participant
April 28, 2016

Here are the answers to your questions:

- Acrobat or Reader installed?

Acrobat and Reader are both installed

- What version?

Both version 9.0

- You say this is in C# code - but in what environment?  App? Browser? other?

A Windows Desktop Application hosted on Citrix.

- What do you mean that "the file is located on a network"?   Over HTTP?  SMB?  Other?

The network location looks like this: \\server\folder\file.pdf

- What information is included in the exception?  Your catching it will give you error #'s and messages. What are they?

The exception message was: "Error HRESULT E_FAIL has been returned from a call to a COM component."

The stack trace points to the LoadFile() method:

at AcroPDFLib.IAcroAXDocShim.LoadFile(String fileName)

at AxAcroPDFLib.AxAcroPDF.LoadFile(String fileName)

This exception doesn't happen every time the file is opened, so it seems the PDF is OK.

The PDF versions are: 1.6 and 1.7

lrosenth
Adobe Employee
Adobe Employee
April 28, 2016

Thanks – that helps me to give you an answer, but not one you will be happy with.

Adobe no longer supports Acrobat & Reader 9 – we haven’t for 3 years now. (see https://helpx.adobe.com/acrobat/kb/end-support-acrobat-8-reader.html)

In addition, Acrobat and Reader 9 were the first versions to be supported on Citrix. And MANY issues were found.