PDF to PNG with high resolution

佐手、 提交于 2019-12-08 12:56:31

问题


I want to convert a PDF file to PNG, I want the output to be 595*842 with high resolution,

I used this command:

gswin64.exe -q -sDEVICE=png16m -dSAFER -dMaxBitmap=1000000000 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dPDFFitPage=true -sDEVICE=pngalpha -dBATCH -dNOPAUSE -sOutputFile=C:\cover.png C:\cover.pdf

I know that I can use -r300 but it will change the dimension to 2479*3509 also, I've tried -sPAPERSIZE=a4 + -r300 which didn't work.

How can I have the output in 595x842 with high resolution?

Current code:

ProcessInfo = new System.Diagnostics.ProcessStartInfo( "gswin64.exe", "-q -sDEVICE=pngalpha -dBATCH -dNOPAUSE -sOutputFile=C:\\Users\\MNiyatkhair\\Desktop\\cairoCopy\\cover.png C:\\Users\\MNiyatkhair\\Desktop\\cairoCopy\\Holding.pdf" ); 
// -r300 
ProcessInfo.CreateNoWindow = true; 
ProcessInfo.UseShellExecute = true; 
ProcessInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 
Process = Process.Start(ProcessInfo); Process.WaitForExit(); 

回答1:


You can try to increase the image resolution (for example -r(72*3)) and add proportional downscale factor -dDownScaleFactor=3. It will work like native PDF MatrixTransform.



来源:https://stackoverflow.com/questions/14995170/pdf-to-png-with-high-resolution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!