Thursday, July 14, 2016

convert PDF to JPG image in C#.Net

//Pdf to jpg file Convert in C#.Net
 string cmd = "\"" + System.Windows.Forms.Application.StartupPath + "\\gswin64.exe \"";

       
            string argu = " -dNOPAUSE -dBATCH -dSAFER -sDEVICE=jpeg -djpegq=500 -r500  -dNumRenderingThreads=8 -sOutputFile=" + "\"" + System.Windows.Forms.Application.StartupPath + "\\" + FileName+ "%d.jpg" + "\" " + " \"" + PathAndFileName + "\"";
     
         
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo.FileName = cmd;
            proc.StartInfo.Arguments = argu;
            proc.StartInfo.CreateNoWindow = true;
            proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            proc.Start();
            proc.WaitForExit();

No comments: