سلام دوستان عزیز ! در این پست ، کد تبدیل pdf به عکس JPEG در سی شارپ رو براتون قرار دادم.انشاالله که این آموزش به دردتون بخوره و مورد استفاده قرارش بدین.
دقت کنید قبل از کدهای برنامه این کد رو به فضای نام برنامتون به قسمت بالای کدها اضافه کنید:
using System.Diagnostics;
//Add gswin64.exe in your root folder
strring FileName = "type here file name for ex. 1.pdf"
string PathAndFileName = "type here file path with file name for ex. d:\abc\1.pdf"
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;
strring FileName = "type here file name for ex. 1.pdf"
string PathAndFileName = "type here file path with file name for ex. d:\abc\1.pdf"
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;