且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用ImageMagick的用C#

更新时间:2023-02-07 20:50:01

 字符串参数=的String.Format(@ - 密度300 {0} .PDF {1}的.png,intputFileName,outputFileName); 
变种的StartInfo =新的ProcessStartInfo {
参数=参数,​​
=文件名@C:\path\to\imagick\convert.exe
};
的Process.Start(StartInfo的).WaitForExit();

参考文献:




Could you explain how I can use ImageMagick with C# . I am trying to convert PDF to pages into images.

I want to run imageMagick command "convert -density 300 $input.pdf $output.png"

string arguments = string.Format(@"-density 300 {0}.pdf {1}.png", intputFileName, outputFileName");
var startInfo = new ProcessStartInfo {
    Arguments = arguments,
    Filename = @"C:\path\to\imagick\convert.exe"
};
Process.Start(startInfo).WaitForExit();

References: