Question

On Ubuntu 10.04, I've installed the poppler-utils package to be able to run pdftoppm.

My goal is to convert PDFs to jpegs, however I don't have that option/flag available. The only rasterizer I seem to have is PNG support.

Could someone please advise how I can get jpeg support? Many thanks.

(See my options list below after running: 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
Was it helpful?

Solution

According to this page it should be possible to use the option -jpeg to generate a jpeg image as result. If you can't you should get a newer version maybe, if you are allowed to.

If not the only solution is to convert it afterwards. But in any way, if you are having the feeling that the JPEG conversion is too slow, I'd give you the advise to use libjpeg-turbo. If you replace the standard libjpeg library you should get a performance boost of the factor 2 at least.

OTHER TIPS

It seems that older version of pdftoppm does not provide such features to export PDF as JPEG images. Only newer versions support that, I am using version 0.82.0. I can confirm that this version support exporting PDF as JPEG or TIFF images.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top