I use the command

convert *.png -flip -page 2647x3745+50+50 doc.pdf

to produce a pdf from scanned images.

I put the option flip in because convert uses the lower-left corner instead of upper-left as reference point. Now I need to flip the pages again.

convert doc.pdf -flip doc2.pdf

Hovever, now the result is very poor resolution (unreadable). Ideally I would like to tell convert to use the upper-left corner instead. I tried -gravity NorthWest but that placed each image with the image upper-left corner in the middle of the page.


Try to control the resolution through the density option. If your original scanned document was with a density of 300dpi you can use:

convert -set units PixelsPerInch *.png -density 300 -flip -page 2647x3745+50+50 doc.pdf
convert -set units PixelsPerInch  -density 300 doc.pdf -flip  -density 300 doc2.pdf

the downside is that it will increase the size.
You can obtain an equivalent output even with those 2 lines

convert *.png -flip -page 2647x3745+50+50 doc.b.pdf
convert -set units PixelsPerInch  -density 300 doc.b.pdf -flip doc2.b.pdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.