将多页PDF转换为单个图像
我正在尝试使用GhostScript将PDF转换为单个图像.
I'm attempting to convert a PDF into a single image using GhostScript.
仅第一页被转换,而我的意图是生成一个可怕的高PNG/JPG图像,其中所有页面都连接在一起.
Only the first page is converted, while my intention is to generate a horrendously tall PNG/JPG image with all the pages concatenated together.
这些是我当前传递给GhostScript DLL(通过.NET应用程序)的参数:
These are the parameters I'm currently passing to the GhostScript DLL (via a .NET application):
pdf2img \
-dNOPAUSE \
-dBATCH \
-dSAFER \
-sDEVICE=png256 \
-dGraphicsAlphaBits=4 \
-dTextAlphaBits=4 \
-dDOINTERPOLATE \
-dAlignToPixels=1 \
-r300x300 \
-sOutputFile=GLOSS.png \
GLOSS.pdf
是否可以通过GhostScript将所有页面连接在一起?还是应该诉诸外部方法?
Is it possible to concatenate all the pages together via GhostScript? Or should I resort to an external method?
您是否看过 ImageMagick ?这个免费的库可能有一个选项,可以从PDF创建单个图像(它实际上使用Ghostscript,但增加了许多图形编辑功能,例如合并图像).
Did you have a look at ImageMagick? This free library might have an option to create a single image from a PDF (It actually uses Ghostscript but adds a lot of graphical editing capabilities such as merging images).