ghostscript处理pdf文件

ghostscript下载地址

https://github.com/ArtifexSoftware/ghostpdl-downloads/releases

centos下源码编译安装ghostscript

wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10031/ghostscript-10.03.1.tar.gz

./configure --prefix=/usr/local/ghostscript-10.03.1
make -j4


wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10040/ghostscript-10.04.0.tar.gz

mkdir /usr/local/ghostscript-10.04.0
./configure --prefix=/usr/local/ghostscript-10.04.0
make -j4

linux下命令行操作

转换pdf文件格式为1.5
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -o output.pdf input.pdf

合并1.pdf 2.pdf 3.pdf文件
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOUTPUTFILE=merge.pdf 1.pdf 2.pdf 3.pdf

windows下命令行操作

windows下转换pdf文件为1.7
gswin64c -sDEVICE=pdfwrite -dCompatibilityLevel=1.7 -o output.pdf input.pdf
冀ICP备2021025979号-1