linux下图片转换为pdf

linux下将图片转换为pdf,linux下刚好有现成的工具

主要是利用 

ImageMagick的convert工具

具体见

http://www.imagemagick.org/script/formats.php?ImageMagick=ub4j63teftfck37e2tnt9nh253

使用时可以用如下简单的命令:

扫描二维码关注公众号,回复: 830473 查看本文章

convert *jpg +compress output.pdf 

如果是tif的图片还能直接转成pdf,需要先用convert转成jpg才可以

 convert lab.tif -resize 50% resize.jpg

如果是将多个pdf合并为一个pdf,可以使用linux下的gs

 gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=test.pdf  1.pdf 2.pdf  3.pdf

pdf转成tiff

windows

gswin32c -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf

linux

gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg4 -sOutputFile=/tmp/melbourne.tif -f /tmp/melbourne.pdf

参见:http://www.troubleshooters.com/linux/gs.htm

Details of Ghostscript output devices

http://pages.cs.wisc.edu/~ghost/doc/AFPL/8.00/Devices.htm#TIFF

猜你喜欢

转载自dikar.iteye.com/blog/1576056