Monday, September 29, 2014

Finding Type 3 fonts in PDFs

It can be painful to fail the IEEE PDF check because of wrong fonts that made it into your PDF file. Here's a little shell script that helps to locate where Type 3 fonts are hiding.

#!/bin/bash

 for i in `seq 1 1 \`pdfinfo XXX.pdf|grep 'Pages'|cut -d: -f2|sed -e 's/ //g'\``
 do
   echo ""
   echo Page $i;
   echo "font name                            type              emb sub uni object ID"
   echo ------------------------------------ ----------------- --- --- --- ---------
   pdffonts -f $i -l $i XXX.pdf|grep 'Type 3';
 done