How to find out which fonts are referenced and which are embedded in a PDF document

PdfFonts

Pdf Problem Overview


We have a little problem with fonts in PDF documents. In order to put the finger on the problem I'd like to inspect, which fonts are actually embedded in the pdf document and which are only referenced. Is there an easy (and cheap as in free) way to do that?

Pdf Solutions


Solution 1 - Pdf

pdffonts command line tool originally from Xpdf, now part of Poppler.

This tool is available in most Linux distributions as part of poppler-utils package.

Example usage and output:

$ pdffonts some.pdf 

name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
BAAAAA+Arial-Black                   TrueType          yes yes yes     53  0
CAAAAA+Tahoma                        TrueType          yes yes yes     28  0
DAAAAA+Wingdings-Regular             TrueType          yes yes yes     43  0
EAAAAA+Webdings                      TrueType          yes yes yes     38  0
FAAAAA+Arial-BoldMT                  TrueType          yes yes yes     33  0
GAAAAA+Tahoma-Bold                   TrueType          yes yes yes     23  0
HAAAAA+OpenSymbol                    TrueType          yes yes yes     48  0

Solution 2 - Pdf

Much simpler if you just want to find out the font names: run this from a terminal

strings yourPDFfilepath.pdf | grep FontName

Solution 3 - Pdf

I finally got an example file that actually seems to have fonts embedded.

Using the normal Adobe Reader (or Foxit if you prefer). Select File->Properties on the resulting Dialog choose the Font tab. You will see a list of fonts. The ones that are embedded will state this fact in ( ) behind the font name.

Solution 4 - Pdf

CAM::PDF has a font reporter, available as a command-line utility or via a library call. If you run "listfont.pl file.pdf" you get output like this:

Page 1:
  Name: F1.0
    Type: TrueType
    BaseFont: NZUXSR+Impact
    Encoding: MacRomanEncoding
    Widths: yes
      Characters: 0-255
    Embedded: yes
  Name: F2.0
    Type: TrueType
    BaseFont: XSFKRA+ArialMT
    Encoding: MacRomanEncoding
    Widths: yes
      Characters: 0-255
    Embedded: yes

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJens SchauderView Question on Stackoverflow
Solution 1 - PdfvartecView Answer on Stackoverflow
Solution 2 - PdfmichelemView Answer on Stackoverflow
Solution 3 - PdfJens SchauderView Answer on Stackoverflow
Solution 4 - PdfChris DolanView Answer on Stackoverflow