Created
March 5, 2021 15:53
-
-
Save puhoy/b25c17ea98fba9d5daf4ef4b74d88d6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# needs qpdf and docker installed | |
set -x | |
decrypt_command="qpdf --replace-input --decrypt" | |
find . -name "*.pdf" -type f -exec echo DECRYPTING {} \; -exec $decrypt_command {} \; | |
ocr_command="docker run --rm --user $(id -u):$(id -g) --workdir /data -v $PWD:/data -i jbarlow83/ocrmypdf -l deu --rotate-pages --clean-final --jobs 4" | |
find . -name "*.pdf" -type f -exec echo PROCESSING {} \; -exec $ocr_command /data/{} /data/{} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment