0
votes

I'm converting a folder full of print-ready PDFs into 600 dpi TIFFs, using CCITT Group IV compression (bitonal) on the TIFFs (one TIFF per page). My problem is that the PDFs, which begin with a page dimension of 9x6 inches, are converted into 8.5x11 inch TIFFs (5100 x 6600 px at 600 dpi). Here is the command I'm using to convert PDFs to TIFF files (using bash in Mac OS X):

for folder in $(find * -maxdepth 0 -type d ); \
  do gs -dBATCH -dNOPAUSE -q -sDEVICE=tiffg4 -r600 "-sOutputFile=$folder/tiff/%04d.tif" "$folder/pdf/$folder.pdf"; 
done;

Is there a way to preserve the original page dimensions in my output files?

Thanks in advance!

1

1 Answers

1
votes

Ghostscript will preserve the media size of the PDF w3hen creating the TIFF files, so if its not what you expected then either its a bug (you don't say which version of GS you are using, so it might be something that's been fixed) or, more likely, the PDF file has a CropBox which is different to the MediaBox. Screen viewers tend to use the CropBox, Ghostscript defaults to using the MediaBox (because it is at heart a printing application).

You can use the -dUseCropBox switch to have Ghostscript use the CropBox instead, if this is the problem. If it isn't I'd need to see a specimen PDF file. Probably the easiest way is to open a bug report at bugs.ghostscript.com where you can attach a file.