• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4499
  • Last Modified:

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?
0
bastawhiz
Asked:
bastawhiz
  • 6
  • 5
1 Solution
 
softplusCommented:
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).
0
 
bastawhizAuthor Commented:
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.
0
 
softplusCommented:
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?)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
bastawhizAuthor Commented:
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?
0
 
softplusCommented:
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 :).
0
 
bastawhizAuthor Commented:
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.
0
 
softplusCommented:
Hmm. To convert PDF or PS to images you'll need to render everything, i.e. not something very easily done :). I checked xPdf, however the tools available for windows don't seem to be of much use - the other ones are only available for linux/unix versions (so not much help there). The c++ wrapper you are referring to - is it for windows? If so, it "should" be possible to wrap it in a dll and use this from your application. However, that will likely be lots of work....

If you are doing this for yourself (i.e. private) or for a non-profit organisation, you might be able to "beg" a free version of one of those payware-tools - many companies allow you to do that, providing you don't bug them much with support, etc. (unofficially, however :)).

Hmmmm.. Looking through ghostscript - I think it just might do what you want :) - you'll need to shell to it though. You might want to check these links for more ideas:
(skip the printer driver :)) http://www.weather-watch.com/smf/index.php/topic,7653.0.html
(EPS = more or less PDF)  http://www.codecomments.com/archive276-2004-3-157478.html
(ImageMagik uses ghostscript) http://www.demog.berkeley.edu/faq/node29.html
(ghostscript with asp) http://www.codecomments.com/archive276-2004-7-236111.html
Give it a try :)
0
 
bastawhizAuthor Commented:
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
0
 
bastawhizAuthor Commented:
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?
0
 
bastawhizAuthor Commented:
I have just found some resources on my own. Thank you for your assistance.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now