【问题标题】:Why does pdftoppm poppler-utils have no jpeg option?为什么 pdftoppm poppler-utils 没有 jpeg 选项?
【发布时间】:2013-09-10 12:41:07
【问题描述】:

在 Ubuntu 10.04 上,我安装了 poppler-utils 包以便能够运行 pdftoppm。

我的目标是将 PDF 转换为 jpeg,但是我没有该选项/标志可用。我似乎拥有的唯一光栅化器是 PNG 支持。

有人可以告诉我如何获得 jpeg 支持吗?非常感谢。

(运行后查看下面我的选项列表:pdftoppm --help):

pdftoppm version 0.12.4
Copyright 2005-2009 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2004 Glyph & Cog, LLC
Usage: pdftoppm [options] [PDF-file [PPM-file-prefix]]
  -f <int>            : first page to print
  -l <int>            : last page to print
  -r <fp>             : resolution, in DPI (default is 150)
  -rx <fp>            : X resolution, in DPI (default is 150)
  -ry <fp>            : Y resolution, in DPI (default is 150)
  -scale-to <int>     : scales each page to fit within scale-to*scale-to pixel box
  -scale-to-x <int>   : scales each page horizontally to fit in scale-to-x pixels
  -scale-to-y <int>   : scales each page vertically to fit in scale-to-y pixels
  -x <int>            : x-coordinate of the crop area top left corner
  -y <int>            : y-coordinate of the crop area top left corner
  -W <int>            : width of crop area in pixels (default is 0)
  -H <int>            : height of crop area in pixels (default is 0)
  -sz <int>           : size of crop square in pixels (sets W and H)
  -cropbox            : use the crop box rather than media box
  -mono               : generate a monochrome PBM file
  -gray               : generate a grayscale PGM file
  -png                : generate a PNG file
  -freetype <string>  : enable FreeType font rasterizer: yes, no
  -aa <string>        : enable font anti-aliasing: yes, no
  -aaVector <string>  : enable vector anti-aliasing: yes, no
  -opw <string>       : owner password (for encrypted files)
  -upw <string>       : user password (for encrypted files)
  -q                  : don't print any messages or errors
  -v                  : print copyright and version info
  -h                  : print usage information
  -help               : print usage information
  --help              : print usage information
  -?                  : print usage information

【问题讨论】:

  • 您可以生成 PNG 并将其转换为 JPEG。见superuser.com/questions/71028/…
  • 我确实可以,但我试图减少将 500 页 PDF 转换为 jpeg 所需的时间。不幸的是,这个额外的步骤将花费太长时间。我使用的是 ImageMagik 和 GhostScript,但这些花费了太长时间(大约 20 分钟将 500 个 PDF 页面转换为 jpeg)。
  • 你可以通过安装 libjpeg-turbo 而不是 ligjpeg 库来提高速度。

标签: jpeg poppler poppler-utils


【解决方案1】:

根据this page,应该可以使用选项-jpeg 来生成jpeg 图像作为结果。 如果你不能,你应该得到一个更新的版本,如果你被允许的话。

如果不是,唯一的解决方案是事后转换它。 但无论如何,如果您觉得 JPEG 转换太慢,我建议您使用libjpeg-turbo。如果您替换标准 libjpeg 库,您至少应该会获得 2 倍的性能提升。

【讨论】:

  • 最大的遗憾是添加选项以控制 JPEG 质量的补丁仅在几天前提出(他们只花了 5 年时间)。因此,如果您想控制质量,您仍然需要使用其他工具来生成 JPEG。见bugs.freedesktop.org/show_bug.cgi?id=45727
【解决方案2】:

似乎旧版本的 pdftoppm 不提供将 PDF 导出为 JPEG 图像的功能。只有较新的版本支持,我使用的是 0.82.0 版本。我可以确认此版本支持将 PDF 导出为 JPEG 或 TIFF 图像。

【讨论】:

    猜你喜欢
    • 2018-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多