Page 1 of 1

Centering a JPG image to 8.5 x 11 PDF conversion

Posted: 2015-02-24T11:57:06-07:00
by David Bethel
Greetings,

I'm converting multiple 2,000 x 1,600 jpg images to a multi-page PDF ( 11x8.5 paper) 72 DPI

I can get the paper size correct but haven't found he correct parameter to center the image on the page. The image is currently offset to the left side of the page.

Code: Select all

@echo on
convert m:\acad\ar-*.jpg  -resize 765x612  -extent 792x612  -background white  m:\acad\ar-.pdf 
pause
Any suggestions would be very appreciated. -David

Re: Centering a JPG image to 8.5 x 11 PDF conversion

Posted: 2015-02-24T11:59:23-07:00
by fmw42
try adding -gravity center before the -extent and put the -background white before the -extent also (though the latter will not usually make a difference, it is proper IM syntax for settings to go before the operators)

see
http://www.imagemagick.org/Usage/crop/#extent

Re: Centering a JPG image to 8.5 x 11 PDF conversion

Posted: 2015-02-24T12:06:39-07:00
by David Bethel
Prefect ! I had tried -gravity center but not in that order.

Code: Select all

@echo on
C:\IM\convert m:\acad\ar-*.jpg  -resize 765x612  -gravity center  -background white  -extent 792x612  m:\acad\ar-.pdf 
pause
Thanks! -David

Re: Centering a JPG image to 8.5 x 11 PDF conversion

Posted: 2015-02-24T12:13:56-07:00
by fmw42
See http://www.imagemagick.org/Usage/basics/#why regarding proper syntax order

Re: Centering a JPG image to 8.5 x 11 PDF conversion

Posted: 2015-02-24T12:19:52-07:00
by David Bethel
Wow ! That's a bit complex ! Thanks~! -David