LabTIP: How do I do to create scanned books fast

  • Step 1.1: I would take a book and make a picture for each page, from the beginning to the end.
  • Step 1.2: Put it in a folder, named after the book. Containing only the images from the book.
  • Step 1.3: Then, since I need to rotate 90 degrees each picture, I put in a script the following code:

for i in *.JPG; do
convert $i -rotate 90 $i;
done


  • Step 1.4: Then the PDF would be assembled (requires imagemagick)(it names the file automatically after the folder):

gm convert *.JPG "${PWD##*/}".pdf

  • Step 1.5: And finally the DjVu file will be parsed (again it names the file automatically after the folder):

pdf2djvu -o "${PWD##*/}".djvu "${PWD##*/}".pdf --dpi=600


All together:

for i in *.JPG; do
convert $i -rotate 90 $i;
done

gm convert *.JPG "${PWD##*/}".pdf
pdf2djvu -o "${PWD##*/}".djvu "${PWD##*/}".pdf --dpi=600