2012-06-18 96 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'

回答