在 EPS 文件上使用 ps2pdf,并将 PNG 用于位图?

发布于 2024-07-27 23:06:31 字数 509 浏览 4 评论 0 原文

我们目前正在使用 ps2pdf 将 EPS 文件转换为 PDF。 这些 EPS 文件包含矢量信息(线条和文本)和位图数据。

然而,默认情况下,ps2pdf 将这些图像的位图组件转换为 JPG,因为它们嵌入在 PDF 中,而对于我们拥有的图形类型(数据可视化),使用它会更合适无损压缩。 PDF 支持 PNG,因此应该可以实现我们想要做的事情,但我在 有点令人生畏的手册

所以简短的问题是:正确的写法是什么?

   ps2pdf -dPDFSETTINGS=UsePNGinsteadOfJPGcompression input.eps output.pdf

We're currently using ps2pdf to convert EPS files to PDF. These EPS files contain both vector information (lines and text) and bitmap data.

However, by default ps2pdf converts the bitmap components of these images to JPG as they're embedded within the PDF, whereas for the type of graphics we have (data visualisation) it would be much more appropriate to use lossless compression. PDF supports PNG, so it should be possible to achieve what we're trying to do, but I'm having trouble finding a relevant option in the somewhat intimidating manual.

So the short question is: what is the correct way to write this?

    ps2pdf -dPDFSETTINGS=UsePNGinsteadOfJPGcompression input.eps output.pdf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧城空念 2024-08-03 23:06:31

答案是不是 -dUseFlateCompression,因为该选项是指使用 Flate 而不是 LZW 压缩; 两者都是无损的,但 LZW 曾一度受到专利保护。 由于这不再是问题,因此该选项将被忽略。

相反,为实现位图数据的无损编码而调用的选项是:(全部四个)

  -dAutoFilterColorImages=false 
  -dAutoFilterGrayImages=false 
  -dColorImageFilter=/FlateEncode 
  -dGrayImageFilter=/FlateEncode

您可能还想对 MonoImageFilter 执行相同的操作,但我假设 /CCITTFaxEncode 在那里做了合理的工作,所以它不太重要。

The answer is not -dUseFlateCompression, since that option refers to using Flate instead of LZW compression; both are lossless but LZW was covered by patents for a while. Since that's not a problem any more, the option is ignored.

Instead, the options called to achieve lossless encoding of bitmap data are: (all four of)

  -dAutoFilterColorImages=false 
  -dAutoFilterGrayImages=false 
  -dColorImageFilter=/FlateEncode 
  -dGrayImageFilter=/FlateEncode

You might also want to do the same thing with MonoImageFilter as well, but I assume /CCITTFaxEncode does a reasonable job there so it's not too important.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文