I have some scanned PDF files that I want to process using ScanTailor. To do that I need to extract images (as TIFF). I have been using GhostScript as follows:
gs -sDEVICE=tiffgray -r400x400 -dNOPAUSE -dBATCH -sOutputFile="file0000.tiff" "input.pdf"
The problem is I don't know what is the resolution of the original images in PDF. Is there any way to make GhostScript to adapt its resolution based on the images in the PDF file? Or is there any other free Linux software that can do that?
Adobe Acrobat does that:
Colorspace/Resolution Specifies a color space and resolution for the output file. You can let Acrobat determine these settings automatically.