create pdf keeping resolution of pages

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
iusr
Posts: 1
Joined: 2015-09-24T01:52:20-07:00
Authentication code: 1151

create pdf keeping resolution of pages

Post by iusr »

I am struggling creating PDFs from scanned pages that have a fixed DPI but different sizes due to editing.

convert page*.png -density 300 -units pixelsperinch -page A4 out.pdf

creates a pdf, but all individual pages are scaled to fill the page. What I am trying to achieve is to have the original resolution preserved, i.e. if a png has a smaller size there should be empty space around it in the resulting pdf.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: create pdf keeping resolution of pages

Post by fmw42 »

try using -gravity center -background white -extent WxH rather than -page A4. Specify WxH as desired for your output image. But if your images are larger, then -extent will crop
Post Reply