asp.net - PDFCreator 和 ASP.NET

标签 asp.net pdf-generation

有人设法让 PDFCreator 在 ASP.NET 2.0 网站上运行吗?

在我的带有 Visual Studio Web 服务器的开发计算机上,按照此过程后它可以正常工作:

  • 使用 tlbimp 创建 com 互操作 DLL
  • 引用这个dll
  • 编写一些代码来使用它

但是,当我将其部署到我们的测试服务器时,它严重失败并出现以下错误:

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. 

我在 DCOMCNFG.msc 中找不到这个组件。

我们的服务器配置:

  • Windows 2003
  • ASP.NET 2.0
  • MS Office XP
  • PDFCreator 0.9.0

最佳答案

问题是 IIS 进程(以及 ASP.Net 进程)以 SYSTEM 帐户运行,但没有设置任何打印机。

您有两个选择:

1 - 使用 article 为系统帐户设置打印机由克雷格·勒巴肯提供

2 - 模拟 ASP.Net 站点以使用已设置打印机的帐户

关于asp.net - PDFCreator 和 ASP.NET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/221126/

相关文章:

java - node.js 和服务器安全问题

c# - EventLog - 获取可用的日志

c# - 如何判断我的对象的值是 float 还是 int?

android - 将字节数组转换为pdf文件然后保存

java - 使用 Apache PDFBOX 创建网页的 pdf

java - html View 中的 iText 等宽字体,带有 css 样式的粗体、斜体

asp.net - 用户从另一个网站或通过 Web 服务登录到 MVC 应用程序

c# - 检索信息后生成pdf文件

python - 谁能推荐一个支持 OpenType (.OTF) 的 Python PDF 生成器?

c# - 连接字符串 - N 层应用程序