2013-10-21 49 views
2

我有一个两页的PDF我试图转换为PNG文件。当我运行:没有输出文件从GhostScript PDF到PNG转换

gs -sDevice=pngalpha -o=gs-output-%d.png -r400 test1-0.pdf 

我得到:

GPL Ghostscript 9.07 (2013-02-14) 
Copyright (C) 2012 Artifex Software, Inc. All rights reserved. 
This software comes with NO WARRANTY: see the file PUBLIC for details. 
Processing pages 1 through 2. 
Page 1 
%%BoundingBox: 35 35 577 757 
%%HiResBoundingBox: 35.910001 35.910001 576.090022 756.090029 
Page 2 
%%BoundingBox: 35 35 577 757 
%%HiResBoundingBox: 35.910001 35.910001 576.090022 756.090029 

然后什么都没有。根本没有输出文件。我哪里错了?

回答

6

你是如此接近,你会生气;-)

有点手册页阅读这里后是为我工作:

gs -sDEVICE=pngalpha -ogs-output-%d.png -r400 test1-0.pdf 

DEVICE,而不是Device,并-o代替-o=

在如此重要的情况下,我gs的版本是:

GPL Ghostscript 9.05 (2012-02-08) 
+0

美丽!像'GPL Ghostscript 9.07(2013-02-14)'上的魅力一样工作。 – JacobEvelyn

1

试试这个与我理想的工作,并取得了很好的效果:

-sDEVICE=pngalpha -o "$OUTPUTIMAGEFILE" -dFirstPage=1 -dLastPage=2 -dNOPAUSE -dGraphicsAlphaBits=4 -dTextAlphaBits=4 "$INPUTPDFFILE" 

但是我猜,使用-r400是JPEG图像不PNGS

相关问题