Private Static String Createpdf ( String Filename ){ String Command = " Gswin32c-Q-dnopause-sdevice = export write-soutputfile = \"" + Filename + " . Pdf \ "-Fc :\\ output. Ps" ; Console. writeline (command); process P = New Process (); streamwriter SW; streamreader SR; processstartinfo info = New Processstartinfo (" Cmd" ); Info. workingdirectory = system. appdomain. currentdomain. basedirectory; console. writeline ( " Current Directory :" + Info. workingdirectory); Info. createnowindow = True ; Info. useshellexecute = False ; Info. redirectstandardinput = True ; Info. redirectstandardoutput = True ; P. startinfo = Info; p. Start (); Sw = P. standardinput; Sr = P. standardoutput; Sw. autoflush = True ; Sw. writeline (command); Sw. Close (); String Ret = Sr. readtoend (); console. writeline (RET ); Return RET ;}
From: http://www.codeproject.com/Articles/17574/Programmatically-Convert-Documents-to-PDFs-the-Eas