Search code examples
ubuntu-16.04xpdfpdftoppm

pdftoppm converts only one first page of pdf


I need to convert pdf to pgm, and when I run the (example)command

pdftoppm -f 5 -l 10 -gray input.pdf > output.pgm

I am getting the first page of the pdf as output. This is even though I am clearly specifying first page as page 5. I am not specifying -singlefile parameter, that could cause this. Even when I specify a single page, like

pdftoppm -f 5 -l 5 -gray input.pdf > output.pgm

, the first page is converted. Any pointers?


Solution

  • in your case use pdftoppm thusly:

    pdftoppm -gray input.pdf your-output-prefix
    

    it creates files your-output-prefix-X.pgm for every page number X.