But my question is, does it work on client machine as well? Those of you reading this article should not be using Adobe reader version 4.x as it is insecure. I think it's great that this is a plausible solution, but Adobe reader 4.0? Do you have any idea how insecure that program is? You have just told every random programmer who looked up the printing pdf's to put a very old program riddled with software bugs on their web servers. Had it up and running in 5 to 10 minutes. Is it possible to suppress that and Save pdf file behind the scene to any folder location? It is opening Acrobat Reader and asking to save the file. But my requirement is little bit different. When I run this, nothing gets printed, and no exception is thrown. Hello Jonathan, This seems like a good option for me, but when I tried this code in my c# Windows application, it did not work.
Please tell me how to set the page settings in this methords. Thanks to my co-worker and friend, Bob Flanders, for helping find this solution for printing PDF documents. RunExecutable(pathToExecutable, ""mytest.pdf"" ""My Windows PrinterName""") String pathToExecutable = "c:\.\acrord32.exe" You can print your PDF by incorporating the above code into your project and using it as follows: Throw new Exception( string.Format( exited with ExitCode ",Įxecutable, process.ExitCode, buffer.ToString()) Using (StreamReader reader = process.StandardOutput) StringBuilder buffer = new StringBuilder() ProcessStartInfo starter = new ProcessStartInfo(executable, arguments)
Private static void RunExecutable( string executable, string arguments) I have used the following code in several projects to start various executables and we can use it to start Adobe Acrobat Reader too. NET Framework provides classes in the System.Diagnostics namespace that can be used to start external processes. NET application without annoying dialogs or other user intervention? Need to automatically print a PDF document from your. Print Add To Favorites Email To Friend Rate This Article ASP.NET Tutorials » CodeSnip: Printing PDF from.