views:

951

answers:

2

Has anyone managed to get PDFCreator running on an ASP.NET 2.0 website ?

On my development machine with Visual Studio webserver, it works just fine after following this procedure :

  • create a com interop dll with tlbimp
  • reference this dll
  • write some code to use it

However, when I deploy it to our test server, it fails miserably with this error :

Retrieving the COM class factory for component with CLSID {082391C9-8188-4364-B4FD-66A1524B2097} failed due to the following error: 80070005.
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.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {082391C9-8188-4364-B4FD-66A1524B2097} failed due to the following error: 80070005.

And I can't find this component in DCOMCNFG.msc.

Our server configuration :

  • Windows 2003
  • Asp.net 2.0
  • MS Office XP
  • PDFCreator 0.9.0
+1  A: 

The following Microsoft Knowledgebase article describes the problem and a solution:

COM objects fail to print when called from ASP

Craig Lebakken
+1  A: 

The problem is that IIS process (and so ASP.Net processes) run as the SYSTEM account, wich does not have any printers set up.

You have two options:

1 - Set up the printers for the syste amccount using the article provided by Craig Lebakken

2 - Impersonate the ASP.Net site to use an account wich has the printers set up

mapache