title: PDF on Linux: Combine font subsets and replace Type 3 with Type 1
body: <p>I have a PDF file that I'd like to post-process on Linux. In particular I'd like to:</p>
  
  <ul>
  <li>Replace Type 3 fonts with Type 1 fonts</li>
  <li>Replace multiple subsets of the same font with a single subsets (the subsets are the result of including figures in LaTeX, where each figure contains a subset'ed font)</li>
  </ul>
  
  <p>With Windows these two steps are possible with the Adobe Distiller (open the document file and print it into a new PDF document with the respective settings).</p>
  
  <p>On Linux I'm able to subset fonts with Ghostscript <sup>[1]</sup>, but it does not seem to be able to replace (all?) Type 3 fonts with Type 1 fonts or to combine multiple subsets of the same font.</p>
  
  <p>Any hints on how I can achieve these two tasks with free tools?</p>
  
  <p>(I am aware of the reply to <a href="https://stackoverflow.com/questions/2085059/how-to-convert-type-3-font-to-type-1-font-in-pdf">How to convert Type 3 font to Type 1 font in PDF</a>. However, I don't really care if I theoretically lose information about the font, as this conversation seems to work fine in Distiller).</p>
  
  <hr>
  
  <p>[1] With the arguments:</p>
  
  <pre><code>gs -dPDFA -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH \
     -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
     -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 \
     -dMaxSubsetPct=100 -dSubsetFonts=true \
     -dEmbedAllFonts=true -sOutputFile=/tmp/tmp.pdf -f "$1"
  </code></pre>