What command to use in the terminal to scan multiple pages? I normally use scanimage > myimage.pnm for 1 page scanning.


The --batch* options provide the features for scanning documents using document feeders. --batch [format] is used to specify the format of the filename that each page will be written to. Each page is written out to a single file. If format is not specified, the default of out%d.pnm (or out%d.tif for --format tiff) will be used. format is given as a printf style string with one integer parameter.

  • --batch-start start selects the page number to start naming files with. If this option is not given, the counter will start at 0.

  • --batch-count count specifies the number of pages to attempt to scan. If not given, scanimage will continue scanning until the scanner returns a state other than OK. Not all scanners with document feeders signal when the ADF is empty, use this command to work around them.

  • With --batch-increment increment you can change the amount that the number in the filename is incremented by. Generally this is used when you are scanning double-sided documents on a single-sided document feeder.

  • A specific command is provided to aid this: --batch-double will automatically set the increment to 2. --batch-prompt will ask for pressing RETURN before scanning a page. This can be used for scanning multiple pages without an automatic document feeder.

  • miss a commandline example... was not working for me for example a "scanimage --format=jpeg --resolution=150 -b ~/locations/documents/$(date +%Y%m%d)_factures_%d.jpg" – Philippe Gachoud Feb 24 '15 at 11:17
  • Note that if you don't mention the document size (using -x and -y options of scanimage), all pages of the ADF may be seen as a single page. – Skippy le Grand Gourou Apr 14 '15 at 12:48
  • What about on scanners that "feed" the document through? I'm sick of having to wait an equal amount of time for the scanner to "connect" as it takes to actually scan a full length item, simple because I have to invoke scanimage every time i want to scan one page! – Michael Jun 18 '19 at 2:41

scanimage --format tiff --batch=$(date +%Y%m%d_%H%M%S)_p%04d.tiff --resolution 150

Followed by convert *.tiff yourDocumentName.pdf if you need it to be a PDF

See scanimage --help for more options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.