Page 1 of 1

noobie convert pdf to tiff

Posted: 2009-09-16T04:20:57-07:00
by Nik
Hi all,

I'm new to ImageMagick and I'm having a few problems understanding the options

Firstly I started by converting a PDF into a tif using a Terminal window on my Mac running OS 10.5.8 and ImageMagick 6.5.4-0
convert mypdf.pdf mytif.tif

This worked fine but produced a 72dpi image, so I added the -density 300 option and this produced a 72dpi image but had changed the image width to 300cm!!! so I tried the same -density 300 option but changed the output format to jpg and that created me a 300dpi image with the width and height being preserved at the there original dimensions which is what I was hoping for but in tif format, is this something I'm doing wrong or a limitation of the tif output format? my command was:

convert -density 300 '/Users/nikj/Desktop/2_LBP_GRILEGP_TST.pdf' '/Users/nikj/Desktop/2_LBP_GRILEGP_TST.tif'

Ideally what I would like to do is make a thumbnail image of the PDF that's no larger than 5cm tall but has a resolution of 300dpi in a tiff format. I know I can change the physical size using -resize 50x50 but until I get the resolution and format sorted I don't want to go any further.

As a last point of interest does it matter where the options are specified in the command i.e should the -resize command be specified before the output file path or at the beginning of the command after the -density??

Any help would be appreciated,

Thanks,

Nik

Re: noobie convert pdf to tiff

Posted: 2009-09-16T08:11:55-07:00
by fmw42
syntax is usually

convert input options output

but for some things there are read options that need to be specified before the input, such as density for an input pdf

see http://www.imagemagick.org/Usage/basics/#cmdline

with respect to your size and density issue, you may want to use -resample to do both. -density changes the dpi but not the pixel size, -resize or -thumbnail changes the pixel size but not the density, -density does both. But I am not an expert on this, nor know if it should be specified before or after your input with respect to pdf. I would think you may need to specify -density before reading in the input and then -resample afterwards to get the pixel size and density you want. Otherwise, use -density before and -resize or -thumbnail after the input.

see http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/script/comma ... p#resample
http://www.imagemagick.org/Usage/resize/#resample
http://www.imagemagick.org/Usage/resize/

P.S. Photoshop (not sure you are using it, looks in a different place to find resolution), see the end of the tiff section at http://www.imagemagick.org/Usage/formats/#tiff

Re: noobie convert pdf to tiff

Posted: 2009-09-16T10:32:57-07:00
by Nik
Hi,

Thanks for your response. I've been reading and playing with the examples and think I've achieved what I want using the jpg format and maybe I'll take a look at making this work for a tif. My command looks like this:

convert -density 1500 a.pdf -resize 434x434 a.jpg

this gives me a jpg that has a resolution/density of 150 ppi (photoshop) and a Document width of 5cm, which is what I'm after and now I understand the options a little better and how they work together!!!! So many thanks once again.

One thing I would like to know is, is it possible to use the trim box in a pdf and crop my output image to that. The reason being I have a PDF with trim/crop marks on it and I would like to crop the image to its desired trim size at the same time as creating my 150 ppi 5cm tif.

Many thanks in advance,

Nik

Re: noobie convert pdf to tiff

Posted: 2009-09-16T15:06:14-07:00
by fmw42
see http://www.imagemagick.org/Usage/formats/#eps for notes about using trimbox and cropbox with PDF