Convert PDF file (pages 1 through 3) to an image with 150 dpi resolution

gs

gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -dFirstPage={{1}} -dLastPage={{3}} -sOutputFile={{output_%d.jpg}} {{input.pdf}}

click the source code to copy install gs on any operating system with command-not-found.com