pdftoppm fails to create output

2k views Asked by At

I'm running pdftoppm from command prompt but it fails to create any output.

here is my input

c:\test>pdftoppm -r 600 png W10475.pdf test

here is what files I have in the associated 'test' directory

c:\test>dir
 Volume in drive C is OS
 Volume Serial Number is 32C5-D3A1

 Directory of c:\test

10/11/2017  03:36 PM    <DIR>          .
10/11/2017  03:36 PM    <DIR>          ..
10/06/2017  10:00 PM            42,552 convert.exe
10/06/2017  10:00 PM            42,552 magick.exe
08/08/2017  04:22 PM         1,179,648 pdfinfo.exe
08/08/2017  04:22 PM         1,988,096 pdftoppm.exe
08/08/2017  04:22 PM         1,239,040 pdftotext.exe
06/02/2017  12:24 PM           805,964 tesseract.exe
10/09/2017  02:36 PM         5,076,873 W10475.pdf
10/09/2017  02:37 PM         6,376,241 W10926.pdf
10/09/2017  02:37 PM         7,272,812 W11240.pdf
10/09/2017  02:37 PM        11,403,203 W11285.pdf
10/09/2017  02:37 PM         4,576,258 W11292.pdf
10/09/2017  02:37 PM         5,819,421 W11335.pdf
              12 File(s)     45,822,660 bytes
           2 Dir(s)  53,296,689,152 bytes free

And here is the output from my command

pdftoppm version 4.00
Copyright 1996-2017 Glyph & Cog, LLC
Usage: pdftoppm [options] <PDF-file> <PPM-root>
  -f <int>          : first page to print
  -l <int>          : last page to print
  -r <number>       : resolution, in DPI (default is 150)
  -mono             : generate a monochrome PBM file
  -gray             : generate a grayscale PGM 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
  -cfg <string>     : configuration file to use in place of .xpdfrc
  -v                : print copyright and version info
  -h                : print usage information
  -help             : print usage information
  --help            : print usage information
  -?                : print usage information

There are no error messages thrown and no files written to the c:\test folder. I thought pdftoppm.exe would write to the same folder it is called from. Am I mistaken, or is there just no output being written? If that is the case, how do I get it to generate some output.

2

There are 2 answers

0
K J On BEST ANSWER

Questions become dated over time and the answer is now significantly different for windows users in 2021, however the confusion is often due to which of the two sets of pdfto### utils you are running.

First the Question was why the Xpdf command to produce a PNG from Utils is not working as per Poppler utils. However you need to use the dedicated pdftopng exe. (note the G&C pdftoppm help screen above clearly does/did not show -png as an valid output option)

pdftopng.exe -v4.##- converts a PDF file to a series of PNG image files

 pdftopng -r 600 file.pdf test

will produce output file test-000001.png etc.

Note you can add the optional -alpha and there are many other options, here is the current 4.03 help screen.

pdftopng --help

pdftopng version 4.03 [www.xpdfreader.com]
Copyright 1996-2021 Glyph & Cog, LLC
Usage: pdftopng [options] <PDF-file> <PNG-root>
  -f <int>          : first page to print
  -l <int>          : last page to print
  -r <number>       : resolution, in DPI (default is 150)
  -mono             : generate a monochrome PNG file
  -gray             : generate a grayscale PNG file
  -alpha            : include an alpha channel in the PNG file
  -rot <int>        : set page rotation: 0, 90, 180, or 270
  -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
  -cfg <string>     : configuration file to use in place of .xpdfrc
  -v                : print copyright and version info
  -h                : print usage information
  -help             : print usage information
  --help            : print usage information
  -?                : print usage information

For Poppler 21.## users you will still need to use the pdftoppm command with -png option.

poppler-21.09.0\Library\bin> pdftoppm -r 600 -png file.pdf test

which will produce a similar output file test-1.png etc.

0
Luti On

The command must be: pdftoppm -r 600 -png W10475.pdf test