I use GS to convert from PDF to JPEG and follow the command I use:
gs -sDEVICE=jpeg -dNOPAUSE -dBATCH -g500x300 -dPDFFitPage -sOutputFile=image.jpg image.pdf
In this command, since you can see that -g500x300 is to set the size of the converted image (width x height).
Is there a way to simply set the width without having to enter the height so that it is based on the width to scale the height using its original aspect ratio? I know this can be achieved using ImageMagick convert, where you just put 0 on the height parameter ie -resize 500x0 . I tried with GhostScript, but I don't think this is the right way to do this.
I decided not to use ImageMagick conversion because it is very slow when it comes to converting large PDFs with multiple pages.
Thanks for the help!
Charlie kee
source share