pdfjpeggraphicsmagick

converting a pdf page to an image using GraphicsMagick


How do I convert only page 2 of a pdf file to a jpg image file, using GraphicsMagick command line prompt?

What option can I use in the gm.exe convert command?

gm.exe convert testing.pdf testing.jpg

Solution

  • Add the page number (starting from zero) in square brackets after the PDF filename:

    gm.exe convert testing.pdf[1] testing.jpg
    

    By the way, you can use the same indexing technique for accessing specific frames of a GIF animation, or layers of multi-layer/directory TIFFs.