【发布时间】:2011-11-22 03:48:06
【问题描述】:
当我使用以下 ghostscript 命令从 PDF 生成 jpg 缩略图时,图像质量通常很差:
gs -q -dNOPAUSE -dBATCH -sDEVICE=jpeggray -g465x600 -dUseCropBox -dPDFFitPage -sOutputFile=pdf_to_lowres.jpg test.pdf
相比之下,如果我使用ghostscript生成一个高分辨率的png,然后使用mogrify将高分辨率的png转换为一个低分辨率的jpg,我会得到相当不错的结果。
gs -q -dNOPAUSE -dBATCH -sDEVICE=pnggray -g2550x3300 -dUseCropBox -dPDFFitPage -sOutputFile=pdf_to_highres.png test.pdf
mogrify -thumbnail 465x600 -format jpg -write pdf_to_highres_to_lowres.jpg pdf_to_highres.png
有没有什么方法可以在绕过中间 pdf -> high-res png 步骤的同时取得好的效果?我需要为大量 pdf 执行此操作,因此我试图将计算时间最小化。
以下是上述图片的链接:
【问题讨论】:
-
看看this helpful answer,它可能会在不使用 Ghostscript 的情况下解决您的问题。它对我有用。
标签: pdf ghostscript postscript