2012-06-18 63 views
0

我介绍了这个代码片段(http://stackoverflow.com/questions/2599925/how-to-print-pdf-on-default-network-printer-using-ghostscript-gswin32c-exe - 她),它工作得很好。我可以从我的wcf服务中无声打印文件。使用ghostscript通过IIS打印pdf

但是我得到一个问题,如果我通过IIS运行这个。 意味着“http:// localhost:5030/mywcf”完美工作。 如果我将其更改为“http://172.16.16.1/mywcf”,则面临以下错误。这里是堆栈跟踪。

 
----------------------------------------------------- 

[06-18-12 03:38:48] GetSignoff(): The handle is invalid : at System.Diagnostics.Process.CreatePipeWithSecurityAttributes(SafeFileHandle& hReadPipe, SafeFileHandle& hWritePipe, SECURITY_ATTRIBUTES lpPipeAttributes, Int32 nSize) 
    at System.Diagnostics.Process.CreatePipe(SafeFileHandle& parentHandle, SafeFileHandle& childHandle, Boolean parentInputs) 
    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) 
    at System.Diagnostics.Process.Start() 
    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) 
    at XX.XX.PrintPDF.PrintVSPDF(String ghostScriptPath, Int32 numberOfCopies, String printerName, String pdfFileName) in D:\XX\Code\Server_MU\eBusiness\Business\PrintPDF.cs:line 551 
    at XX.Business.PrintPDF.Print(String patientId, String reportName, String loginId, String mailMessageId, String deviceId, String facilityId, String noteId) in D:\XX\Code\Server_MU\XX\Business\PrintPDF.cs:line 498 
------- 

然后我试着执行通过cmd.exe生成的同样的命令,它工作正常。任何提示都可能有帮助。

在此先感谢。

RGDS, pa'1'

回答