用 Ghostscript 压缩 PDF

降低图像分辨率并重写 PDF 以缩小体积。

Linux压缩转换PDF低风险
运行 gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf big.pdf 压缩。

01命令

命令
$ gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf big.pdf

02作用说明

Ghostscript 会重新渲染并输出 PDF,PDFSETTINGS 预设(/screen、/ebook、/printer、/prepress)可在画质与体积间取舍。它还能把 PostScript 或 EPS 转成 PDF,并合并透明层。

03风险

风险低风险
使用条件sudo apt install ghostscript
!注意: 重新编码会降低画质,可能改变字体和嵌入颜色;验证结果前请保留原文件。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • Ghostscript
    Official project · vendor-doc · 2026-09-20
    依据: Debian packages Ghostscript, a PostScript and PDF interpreter used to rewrite and optimise documents.
  • Debian package: ghostscript
    Debian · vendor-doc · 2026-09-20
    依据: Debian packages Ghostscript, a PostScript and PDF interpreter used to rewrite and optimise documents.

最后验证: 2026-09-22 · 分类: 开发者