Skip to content

Instantly share code, notes, and snippets.

@tenomoto
Created May 25, 2017 07:21
Show Gist options
  • Save tenomoto/8b740d699d46a71f4f01ddff2e31a619 to your computer and use it in GitHub Desktop.
Save tenomoto/8b740d699d46a71f4f01ddff2e31a619 to your computer and use it in GitHub Desktop.
Find and move PDF files without embedded fonts
#!/bin/sh
if [ ! -d pdf ]; then
echo "put PDF in pdf"
fi
if [ ! -d pdf_not_embedded ]; then
mkdir pdf_not_embedded
fi
cd pdf
for f in *.pdf; do
isEmb=`pdffonts ${f} | awk '$4=="no" {print "no"}'`
if [ "${isEmb}" ]; then
echo ${f}
mv ${f} ../pdf_not_embedded/
fi
done
cd ${OLDPWD}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment