将多页PDF转换为单个图像
问题描述:
我必须将多页PDF文档转换为.png图像。
I have to convert a multipage PDF document to a .png image.
我尝试使用ImageMagick,但我无法达到最终结果:
I try with ImageMagick, but I cannot achieve final result:
convert document.pdf document.png
或
convert -adjoin document.pdf document.png
此命令创建N个图像.png(其中N =文档页面的数量):
This command create N images .png (where N=num of page of document):
document0.png
document1.png
....
document(N-1).png
如果可能的话,我需要一个命令来获得单个图像。
I need, if possible with a single command, to obtain a single image.
答
最后我找到 THE 解决方案:
convert in.pdf -append out%d.png
感谢这篇文章。
作为一个加号,相反的操作是:
As a plus, the opposite operation is:
convert *.png output.pdf
或者如果你有foo1.png,foo2.png..fooN.png
or if you have foo1.png, foo2.png..fooN.png
convert foo?.png output.pdf
请注意,这不适用于foo01.png,foo02.png..foo0N。 png
Notice that does not work with foo01.png, foo02.png..foo0N.png