Skip to content

Instantly share code, notes, and snippets.

@tavy315
Created November 6, 2020 15:37
Show Gist options
  • Save tavy315/c6ee17bfa8748faa8d37ab862c03ec5c to your computer and use it in GitHub Desktop.
Save tavy315/c6ee17bfa8748faa8d37ab862c03ec5c to your computer and use it in GitHub Desktop.
validate PDF files using pdfcpu (https://github.com/pdfcpu/pdfcpu)
#!/bin/bash
find . -name "*.pdf" -print0 | while read -d $'\0' file
do
/usr/bin/pdfcpu validate -q "$file" &> /dev/null
if [ $? == "1" ]; then
((if++))
echo "$if) $file PDF file is invalid."
else
echo "."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment