PDF格式为PNG高分辨率 [英] PDF to PNG with high resolution

查看:876
本文介绍了PDF格式为PNG高分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想转换为PDF文件,PNG,我要输出为595 * 842的高分辨率,



我用这个命令:




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




我知道,我可以使用 -r300 但它将尺寸变为2479 * 3509
也有,我已经试过 -sPAPERSIZE = A4 + - R300 没有工作。



我怎么能在595x842的输出分辨率高?



当前代码:

  ProcessInfo =新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.Start(ProcessInfo); Process.WaitForExit();


解决方案

您可以尝试增加图像的分辨率(例如-r(72 * 3)),并添加比例下限系数 -dDownScaleFactor = 3 。它会像原生PDF MatrixTransform。


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(); 

解决方案

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.

这篇关于PDF格式为PNG高分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆