用 Ghostscript 压缩 PDF
降低图像分辨率并重写 PDF 以缩小体积。
运行 gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf big.pdf 压缩。
01命令
命令
$ gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf big.pdf02作用说明
Ghostscript 会重新渲染并输出 PDF,PDFSETTINGS 预设(/screen、/ebook、/printer、/prepress)可在画质与体积间取舍。它还能把 PostScript 或 EPS 转成 PDF,并合并透明层。
03风险
!注意: 重新编码会降低画质,可能改变字体和嵌入颜色;验证结果前请保留原文件。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Ghostscript依据: Debian packages Ghostscript, a PostScript and PDF interpreter used to rewrite and optimise documents.
- Debian package: ghostscript依据: Debian packages Ghostscript, a PostScript and PDF interpreter used to rewrite and optimise documents.
最后验证: 2026-09-22 · 分类: 开发者