Skip to content

Instantly share code, notes, and snippets.

@dwallraff
Last active September 24, 2025 20:35
Show Gist options
  • Select an option

  • Save dwallraff/cd6cedd3d89d9da446165fef8aaffb54 to your computer and use it in GitHub Desktop.

Select an option

Save dwallraff/cd6cedd3d89d9da446165fef8aaffb54 to your computer and use it in GitHub Desktop.
Convert scanned jpeg's to pdf/a with OCR and encrypts them
#! /usr/bin/env bash
for i in $(ls *.jpeg); do
echo "Converting $i..."
img2pdf $i | ocrmypdf -q --output-type pdfa --deskew --clean - ${i%%.*}.pdf
done
# tar hcz *.pdf | gpg --batch --cipher-algo AES256 --symmetric --output "$TODAY"_scanned_mail.tar.gz.enc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment