Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm on Ubuntu 10.04 with imagemagick. I used this command:

convert myfile.pdf -density 300 file.jpg

This works well, but the JPGs are only about an inch high. How can I preserve the paper size in the conversion process?

share|improve this question
    
It might be easier to give a good answer if you give more background, e.g. why you want to do the conversion you describe, what material you are working with and quality you need from results. –  N.N. Oct 28 '11 at 7:01
add comment

2 Answers

I don't know if Imagemagick can sense the correct height automatically. However if you can come up with the correct height in pixel you can set the height manually.

According to http://www.indigorose.com/forums/archive/index.php/t-13334.html an A4 paper has the height of 3508 pixels in 300 dpi so then you can do

convert myfile.pdf -density 300 -geometry x3508 file2.jpg

This command sets the width to 3508 pixels and preserves aspect radio. See http://www.imagemagick.org/script/command-line-processing.php#geometry for details on the -geometry argument.

share|improve this answer
    
Thank you! that works well. I'm using this to automate a scribus publishing project. –  Trude Oct 31 '11 at 13:36
1  
I'm glad it works. If you find an answer helpful you should vote it up by clicking the upward pointing arrow to the left of the answer. Also, you should consider to accept the most helpful answer by marking it as the accepted answer by clicking on the check box outline to the left of the answer. See faq for details. –  N.N. Oct 31 '11 at 14:30
add comment

You can set the -density before you read the source pdf, so you can do

convert -density 300 myfile.pdf myfile.jpg

and it'll read the pdf at 300dpi, then render out the jpg at the original size of the pdf, whatever that was.

share|improve this answer
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.