我使用WebClientPrint 2.0从客户端的打印机自动打印pdf文件。为此,我在项目中添加了Neodynamic.SDK.WebClientPrint.dll文件,并在系统中安装了WebClientPrintAspNet20.exe。我尝试过这个代码http://www.neodynamic.com/articles/Print-PDF-from-ASP-NET-directly-to-default-printer-without-print-dialog/
但是它不会工作,并给我一个错误:
(状态代码: 500)打印作业进程已取消。
请给我一些建议来解决这个错误。
或
任何其他代码打印Pdf直接从客户端的打印机。
发布于 2015-12-01 09:20:03
我们在一个ASP.NET应用程序中也使用了这一点,我最近收到了同样的错误。在我们的案例中发生的情况是,WCP客户端无法连接到服务器处理程序,它抛出一个500。如果您使用的是处理程序(.ashx),就像Neodynamic向我们推荐的那样,我会检查web.config并确保有一个为处理程序正确定义的location部分,即ashx文件,您可以省略或注释掉location部分中的system.webServer部分,如下所示:
<location path="Pages/NeodynamicWebClientPrint.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<!--system.webServer>
<security>
<authorization>
<add accessType="Allow" users="*"/>
</authorization>
</security>
</system.webServer-->
</location>为了进行故障排除,请尝试导航到处理程序的直接链接,例如:
https://www.ourdomain.com/OurApp/Pages/NeodynamicWebClientPrint.ashx
在编辑位置设置之前,我得到了一个500错误,之后我可以导航,web客户端打印应用程序开始为我们工作。
https://stackoverflow.com/questions/21926949
复制相似问题