Click here to Skip to main content
15,663,550 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have tried with the below code but getting a empty pdf/image.
I want output file(PDF/Image) same as web page along with all the user entered data.
Please guide me.

string myDocumentsPath = "C:\\Program Files (x86)\\GPLGS\\gswin32c.exe";

ProcessStartInfo psi = new ProcessStartInfo(myDocumentsPath, url);

psi.UseShellExecute = false;

psi.RedirectStandardOutput = true;

psi.RedirectStandardInput = true;

psi.RedirectStandardError = true;

psi.CreateNoWindow = true;

Process myProcess = Process.Start(psi);




Response.AddHeader("content-disposition", "attachment;filename=1234.pdf");

Response.ContentType = "application/pdf";


Richard Deeming 1-Apr-15 10:48am    
What command-line arguments are you passing to GhostScript?
shiva2239 2-Apr-15 1:52am    
No.I am not passing from command-line.I want to convert when I click a button in the web page.
Richard Deeming 2-Apr-15 7:51am    
If you don't pass command-line parameters, the program isn't going to magically know what you want it to do.

You need to pass command-line parameters to tell the program what to do:[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900