bundlewrap/bundles/scansnap/files/ocr.sh
Franziska Kunsmann 5d4ca086e6
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/scansnap: do ocr in a separate process to speed up scanning
2021-05-24 10:24:01 +02:00

21 lines
260 B
Bash

#!/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"