Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm looking to convert a .jpg into a .pdf, where the .jpg is positioned at a certain coordinate say 30 pixels and centered.

Right now I'm just using:

convert image.jpg image.pdf

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

I assume you want to add a border of, say 30px, on all four sides. Use the -border option for the size and -bordercolor for the colour:

convert -border 30 -bordercolor white input.png output.pdf

More information can be found here: Imagemagick - Adding/Removing Image Edges

If you want the final PDF to be of a particular size, you can use the following options:

convert \
  -page A4 \
  -gravity northwest \
  -border 30 \
  -bordercolor white \
  input.png output.pdf
share|improve this answer
    
thanks, ya that puts it down 30pixels which i want, also looking to make the pdf a whole page, with just the image 30 pixels down at the top –  chris mccoy Jul 25 '12 at 18:12
    
I updated my answer, but it's hard to tell what you actually want. If it's still not what you are looking for, it might make sense to update your question, rephrase it, add more details or an image of what you want to achieve. –  Marco Jul 25 '12 at 18:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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