Linux 如何减小 PDF 文件大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10351944/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:01:56  来源:igfitidea点击:

How to reduce PDF filesize

phplinuxpdfdebian

提问by clarkk

I got alot of PDF files and some of them are quite large..

我有很多 PDF 文件,其中一些文件很大。

I got two alternatives

我有两个选择

  1. remove images and remove embedded fonts
  2. compress images
  1. 删除图像并删除嵌入的字体
  2. 压缩图像

Is it possible to remove all objects like images/fonts in a PDF (PHP lib or command-line tool)?

是否可以删除 PDF(PHP 库或命令行工具)中的所有对象,如图像/字体?

Or if I want to compress images in the PDF, which PHP library do you recommend (or command-line tool)?

或者,如果我想压缩 PDF 中的图像,您推荐哪个 PHP 库(或命令行工具)?

Debian/PHP

Debian/PHP

回答by Daniele

pdftkis the way to go IMO.

pdftk是去 IMO 的方式。

It can uncompress and compress the textual part of the PDF. Further you can use it in a script to extract all the images, compress them with some other tool and then put them back into your original document.

它可以解压缩和压缩 PDF 的文本部分。此外,您可以在脚本中使用它来提取所有图像,使用其他工具压缩它们,然后将它们放回原始文档中。

I'm not sure whether it can remove embedded fonts.

我不确定它是否可以删除嵌入的字体。

HTH

HTH

回答by mark stephens

Lots of tools, including Acrobat can improve the file size by looking for optimizations such as

许多工具,包括 Acrobat 可以通过寻找优化来改善文件大小,例如

  • dead objects
  • raw image data at an unnecessary resolution.
  • 死物
  • 以不必要的分辨率处理原始图像数据。

Have you looked at any of these tools?

你看过这些工具吗?