To streamline the scan process I intend to create a script that scans and applies OCR in one step. However my bash skills are rather poor, so I would be very thankful for a bit of help. Here my attempt:
#!/bin/bash
mydate="$(date +"%Y%m%d-%H%M%S")"
image="$(scanimage --device "brother4:net1;dev0" --progress --verbose --resolution=600 -l 0 -t 0 -x 210 -y 297 --format=pdf)"
ocrmypdf --deskew "$image" "$mydate".pdf
The command, which works well, without creating a date specific filename is:
scanimage --device "brother4:net1;dev0" --progress --verbose --resolution=600 -l 0 -t 0 -x 210 -y 297 --format=pdf > scan.pdf && ocrmypdf --deskew scan.pdf scan.pdf
Since the OCR process takes some time, the filename containig the time (up to seconds) has to be stored at scantime, and then applied to the final file. Or maybe it is possible -- did not find how -- to pipe the file to ocrmypdf
without naming it and then save the file with date and time informations.