checkpdf (689B)
1 #!/bin/bash 2 3 # check common problems with PDFs before submitting a camera-ready 4 5 FILE="$1" 6 TMP="`mktemp`.pdf" 7 8 echo "CHECK number of pages" 9 identify -verbose "$FILE" | grep "Print size" | wc -l 10 echo "CHECK paper size" 11 identify -verbose "$FILE" | grep "Print size" 12 echo "CHECK print area size" 13 pdfcrop "$FILE" "$TMP" 14 identify -verbose "$TMP" | grep "Print size" 15 rm "$TMP" 16 echo "CHECK metainfo" 17 exiftool "$FILE" | grep -E "^Title|^Author" 18 echo "CHECK metainfo bugs" 19 exiftool "$FILE" | grep "^Warning" 20 echo "CHECK font embedding" 21 # magic: http://stackoverflow.com/a/14435749 22 pdffonts "$FILE" | sed '1,2d' | grep ' no' 23 echo "CHECK font type" 24 pdffonts "$FILE" | sed '1,2d' | grep -v 'Type 1' 25