我正在尝试使用命令行程序convert将PDF转换为图像(JPEG或PNG).这是我试图转换的PDF之一.
我希望程序能够修剪多余的空白区域并返回足够高质量的图像,以便轻松读取上标.
这是我目前最好的尝试.正如你所看到的,修剪效果很好,我只需要提高分辨率.这是我正在使用的命令:
convert -trim 24.pdf -resize 500% -quality 100 -sharpen 0x1.0 24-11.jpg
Run Code Online (Sandbox Code Playgroud)
我试图做出以下有意识的决定:
-sharpen(我已尝试过一系列值)任何有关在最终PNG/JPEG中获得图像分辨率的建议都将非常感谢!
Imagemagick安全策略似乎不允许我执行从pdf到png的转换.转换其他扩展似乎正在起作用,而不是来自pdf.我没有改变任何imagemagick设置,因为我安装它...我正在使用Arch Linux,如果操作系统很重要.
user@machine $ convert -density 300 -depth 8 -quality 90 input.pdf output.png
convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
convert: no images defined `output.png' @ error/convert.c/ConvertImageCommand/3288.
Run Code Online (Sandbox Code Playgroud)