Question

I have imported Acrobat Reader using Components | Import Components. The AcroPdf_TLB unit is created in the Imports directory.

When I try to use the AcrobatReader component, as follows ...

AcroDoc := TAcroPDF.Create(nil);

... I get an 'Unspecified Error' exception (EOleSysError). Any ideas?

Thanks, Pieter.

Was it helpful?

Solution

We use the Adobe Reader plug-in and face this issue often. It particularly surfaces after a user performs a web-update on the Adobe Reader.

Try un-installing (via the Control Panel), then re-installing the latest Adobe Reader.

That invariably clears the issue for our users.

OTHER TIPS

If you are unhappy with the results you are getting there (I was), you might consider giving QuickPDF a try. The price is not unreasonable, they have lots of good PDF functions included and you can display a PDF accurately in a TImage control with a call to RenderPageToStream. One thing I discovered working with form fields is that I had to use their FlattenFormField before rendering to get the form field contents to be included in the rendered image.

Follow up:

I did not mention originally that QuickPDF also works for printing. For form fields, you have to do the same FlattenFormField routine, but the results look good with much less overhead than relying on Acrobat Reader.

Put the component on a TForm, then it probably works.

The Acrobat ActiveX/COM object is notorious for not supporting interfaces of older versions properly. You get EOleSysErrors all over the place.

What I have personally done for a couple of clients, is load the PDF documents in a TWebBrowser.

TWebBrowser is a wrapper around the ActiveX/COM component that Internet explorer uses to display everything.

Adobe is pretty good in making that work with each Acrobat update, so the TWebBrowser then also works.

Note that this only makes sense for displaying the PDF document.

--jeroen

We successfully used the acrobat v6 reader component in our Delphi 7 app, but found that it really requires acrobat v6. Users today who install only acrobat v9 get an error when they use our app to view a pdf because the acrobat component is not backward compatible in this way.

So yes, you can do it, but there are probable issues going forward.

A third party tool is prob best...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top