Reputation: 11
I am working on a Virtual PDF Printer (using redmon & Ghostscript) which have two responsibilities:
Everything works fine except in one peculiar case: When User signout & signin on Windows 10. In this case, the Ghostscript call to redirect to the specified printer gets hanged and stuck. It doesn't comes out unless system restart. I have more dig up and found the issue that whenever print is happening, my program starts with System user (in the case when user signout and signin). And that is why the redirection is not happening. But there is one more issue with this case is reading redmon output to pass to Ghostscript is taking around 4 to 5 seconds. (Normally it is only in milli seconds).
I am using Ghostcript 9.54 (latest) and using the API mentioned in the below GitHub repo: https://github.com/mephraim/ghostscriptsharp
For PDF Write:
String[] ghostScriptArguments = { "-dBATCH", "-dNOPAUSE", "-dSAFER", "-sDEVICE=pdfwrite", "-dAutoRotatePages=/None", String.Format("-sOutputFile={0}", outputFilename), standardInputFilename, "-c "<</Orientation 0>> setpagedevice"" ,@"[/Creator(ZBPrinter 2.1.5 (PSCRIPT5)) /DOCINFO pdfmark", "-f"}; GhostScript.CallAPI(ghostScriptArguments);
For PDF redirect to printer:
String[] ghostScriptArguments = {"-empty", "-dPrinted", "-dBATCH", "-dNOPAUSE", "-dNOSAFER", "-dNOINTERPOLATE", "-dNOCIE","-dNumCopies=1", "-sDEVICE=mswinpr2", String.Format("-sOutputFile=%printer%{0}", printerName),"-f", pdfFilename}; GhostScript.CallAPI(ghostScriptArguments);
Some more observations on User Signout / Signin on Windows 10:
Please help me out in this to find why PDF redirection to specific printer is not working on User signout / sign in on Windows 10.
Thanks, Pradeep Gupta
Upvotes: 0
Views: 807