bundles/scansnap: do ocr in a separate process to speed up scanning
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
d193ec8ef3
commit
5d4ca086e6
4 changed files with 33 additions and 14 deletions
21
bundles/scansnap/files/ocr.sh
Normal file
21
bundles/scansnap/files/ocr.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
DATE=$(date +%F_%H-%M-%S)
|
||||
|
||||
cd "$1"
|
||||
|
||||
convert *.tiff no_ocr.pdf
|
||||
ocrmypdf -l deu no_ocr.pdf has_ocr.pdf
|
||||
|
||||
rm -f *.tiff
|
||||
rm -f no_ocr.pdf
|
||||
|
||||
chown nobody:nogroup has_ocr.pdf
|
||||
|
||||
mv has_ocr.pdf "/srv/scansnap/${DATE}.pdf"
|
||||
|
||||
cd /
|
||||
|
||||
rm -r "$1"
|
Loading…
Add table
Add a link
Reference in a new issue