Nikola Stevanovic
Nikola Stevanovic

Reputation: 251

Ghostscript (PDF to JPG convert) set only height

I tried today convert pdf to jpg with ghostscript. I want as result jpg image with 500 pixels height. So width depends on orginal pdf page width. I call script from terminal with:

gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -dDEVICEHEIGHT=500 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=/home/user/output/%d.jpg /home/user/input.pdf -c quit

but, i get jpg image with height of 842 pixels. Size of input pdf page: 6.73 × 9.49 inch

How can I set only height for image? Thanks

Upvotes: 1

Views: 3021

Answers (1)

KenS
KenS

Reputation: 31141

The PDF interpreter will call for a page size based on the content of the PDF. Unless you set -dFIXEDMEDIA then it will override (mostly) anything you set on the command line. You probably also want to look at the PDFFitPage option. See /gs/doc/use.html

Upvotes: 2

Related Questions