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-0 4021C00940 2} 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.InteropServ ices.COMEx ception: Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-0 4021C00940 2} 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\S earch.aspx Line: 56
Stack Trace:
[COMException (0x80040154): Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-0 4021C00940 2} failed with HRESULT: 0x80040154(Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))).]
ASP.Search_aspx.__Render__ control1(H tmlTextWri ter __w, Control parameterContainer) in c:\Shared\Website\zhigza\S earch.aspx :56
System.Web.UI.Control.Rend erChildren Internal(H tmlTextWri ter writer, ICollection children) +2044699
System.Web.UI.Control.Rend erChildren (HtmlTextW riter writer) +19
System.Web.UI.Page.Render( HtmlTextWr iter writer) +26
System.Web.UI.Control.Rend erControlI nternal(Ht mlTextWrit er writer, ControlAdapter adapter) +25
System.Web.UI.Control.Rend erControl( HtmlTextWr iter writer, ControlAdapter adapter) +119
System.Web.UI.Control.Rend erControl( HtmlTextWr iter writer) +22
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +7780
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
Can anyone help me?
Server Error in '/' Application.
--------------------------
Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-0
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.InteropServ
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.
Line 58: If co Then
Source File: c:\Shared\Website\zhigza\S
Stack Trace:
[COMException (0x80040154): Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-0
ASP.Search_aspx.__Render__
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Page.Render(
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Control.Rend
System.Web.UI.Page.Process
--------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
Can anyone help me?
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.
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?)
ASKER
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?
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 :).
or this: http://asp.net/ControlGallery/ControlDetail.aspx?Control=1722&tabindex=2
They are both payware components, but possibly what you were looking for :).
ASKER
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
ASKER
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?
ASKER
I have just found some resources on my own. Thank you for your assistance.
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).