6

Say I'm scanning in images of documents with something like:

scanimage --mode Gray --resolution 300 -x 215 -y 280 --format=tiff \
    --batch=document-p%d.tiff --batch-prompt

(In the example I've used .tiff format, but I'm open to anything that works.)

What's the easiest way to compile the separate image files into a single PDF file?

Michael Kropat
  • 379
  • 5
  • 12

2 Answers2

8

Using ImageMagick is probably the easiest way:

convert document-p*.tiff output.pdf
Graeme
  • 33,607
  • 8
  • 85
  • 110
  • Nice! It didn't even occur to me that ImageMagick would support pdf. It'll be hard to get any easier than that. – Michael Kropat Jun 11 '14 at 16:41
  • 2
    In practice I ended up running `convert document-p*.tiff -compress jpeg -quality 70 document.pdf`, to shrink the file size by an order of magnitude. – Michael Kropat Jun 11 '14 at 17:36
  • By default on Ubuntu 18.04 this functionality of imagemagick is disabled, see https://askubuntu.com/questions/1081895/trouble-with-batch-conversion-of-png-to-pdf-using-convert for how to enable it. – dshepherd Sep 04 '20 at 08:26
0

Try this.

scanimage -p --resolution 250 --mode Gray -x 210 -y 297 | pnmtops -imageheight 11.7 -imagewidth 8.3 | ps2pdf - output.pdf