I have several pdf files with different sizes and different width to height ratios. Now I want to create fixed-size thumbnails from 1st page of these files. I do this using this command:
gs -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -sOutputFile=d:\test\a.jpeg -dJPEGQ=100 -g509x750 -dUseCropBox=true -dPDFFitPage=true -q d:\test\a.pdf -c quit
Since the original files are of different widths and heights but thumbnails should be of the same size, there will be white margins in the right side or top of the thumbnails. But I want to have equal margins on top and bottom (or right and left) of the thumbnail (just like thumbnail displayed in windows explorer).
Is there any way to do it using GhostScript?