Link to home
Start Free TrialLog in
Avatar of bastawhiz
bastawhiz

asked on

Acrobat DLL issue

I am trying to use the Adobe Acrobat Reader 7.0 Dll AcroRd32.dll in my ASP application to dynamically render PDF files. I can easily add the reference. I can use the reference in my code. Intellesense shows no errors. I have no problems before build. When I try to run the page, I get the following error:



Server Error in '/' Application.
--------------------------------------------------------------------------------

Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-04021C009402} failed with HRESULT: 0x80040154(Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-04021C009402} failed with HRESULT: 0x80040154(Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))).

Source Error:


Line 54:     <%
Line 55:    
Line 56:         Dim cPDF As New Acrobat.AcroPDDoc
Line 57:         Dim co As Boolean = cPDF.Open("C:\Shared\Test.pdf")
Line 58:         If co Then
 

Source File: c:\Shared\Website\zhigza\Search.aspx    Line: 56

Stack Trace:


[COMException (0x80040154): Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-04021C009402} failed with HRESULT: 0x80040154(Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))).]
   ASP.Search_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Shared\Website\zhigza\Search.aspx:56
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2044699
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +119
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7780

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44


Can anyone help me?
Avatar of softplus
softplus

Could it be that you don't have the dll registered on the server? COM-Objects need to be registered before you can use them. If this isn't "your" server (i.e. hosted somewhere), you will need the administrator to do this for you. Also, if the acrobat.acropddoc object needs further obejects/files, these need to be available (and registered if needed) before you can use them. Probably, you will need to have the provider buy and install Acrobat on the server and maybe he won't be able to do this for licensing reasons (I don't know, maybe Adobe restricts the server-side usage?).

You could bypass this by using some other PDF-Generator-Objects, there are some out for .NET specifically, you might try these (see for example componentsource.com).
Avatar of bastawhiz

ASKER

This is on my personal server. I have the DLL registered.... I have tried that many times. I have Acrobat Reader installed.

I am not using the DLL to generate PDFs.... in fact, I am doing quite the opposite. I am using this to read the file and create a rendering of the contents, then scale it down and export it as a thumbnail. I know that QuarkXPress does this, but I don't want to spend any money on this and I have no idea about consuming any QuarkXPress APIs.

I will look at that site and see if there is anything that will suit my needs.
Have you tried to access the dll outside of the ASP.NET context, i.e. through a vb.net program directly? (possibly a permissions problem?)
I have tried that, softplus, and it failed there with almost exact error messages.

In order to skip this problem entirely, is there some way in which I can use another PDF rendering engine?

I am doing some experimenting with Ghostscript, but that seems to be too difficult and slow to use in a production environment where many files are being processed at a time.

I have also looked at XPdf, as well as a few alternatives that may also work. Generally, my main goal is just to convert a PDF to text, graphics, or other misc. formats. Is there anything I can use for this?
Did you see this: http://www.codeproject.com/showcase/pdfrasterizer.asp 
or this: http://asp.net/ControlGallery/ControlDetail.aspx?Control=1722&tabindex=2
They are both payware components, but possibly what you were looking for :).
I had seen the first, but again, both cost money, something I don't have.

I had looked around at GS, and found a VB.Net wrapper. However, it was only PS to PDF. Is there a way to convert PDF to (insert image format here)? I know there is a way to do it with the C++ wrapper, but C++ is the devil's tongue. Is there a way to do any of this in VB?

Also, XPdf provides some nifty apps. For example, PDF->Text, PDF->Images, etc. Is there a way to expose this as an API?

Remember, I need to do all of this from ASP.Net, so it doesn't matter much either way how it does it, as long as it works and is decently fast.
ASKER CERTIFIED SOLUTION
Avatar of softplus
softplus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm thinking that ImageMagik will work. Does it have some sort of API that will do the work right from code rather than command line? I use VB.Net for code, so anything in that language will be greatly appreciated
I've started using ImageMagick. However, the documentation provides little information on using the API/OLE Object. Can you provide me with a bit of documentation, tutorial, sample, or other piece of information that can allow me to complete a standard conversion?
I have just found some resources on my own. Thank you for your assistance.