How to check which fonts are used in a PDF document

Question: I would like to know what fonts are used or embedded in a PDF file. Is there a Linux tool which can check which fonts are used in a PDF document?

To check what fonts are included or used in a PDF file, you can use a command-line utility called pdffonts, which is a PDF font analyzer tool. pdffonts is a part of Poppler PDF utilities package.

Install PDF Utilities on Linux

To install Poppler on Debian, Ubuntu or Linux Mint:

$ sudo apt-get install poppler-utils

To install PDF Utilities on Fedora, CentOS or RHEL:

$ sudo yum install poppler-utils

Check PDF Fonts

pdffonts can list all the fonts used in a PDF document. The basic usage of pdffonts is as follows.

$ pdffonts doc.pdf

The pdffonts tool shows various information about each font used, such as font name/type, or whether or not a font is embedded, etc.

In case of a multi-page PDF document, you can limit font scanning for a range of pages with "-f" (first page), and "-l" (last page) options. For example, if you want to find out which fonts are used in pages 5-10 of a document, run this:

$ pdffonts -f 5 -l 10 doc.pdf

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.


Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

One thought on “How to check which fonts are used in a PDF document

  1. Excellent writeup, as always on xmodulo.com.

    I faced a problem where certain documents (received from my telco) would not display completely on some PDF readers live okular and evince.

    Would like to add a reference to the enclosed discussion on stackoverflow.com :

    Problem was that the PDF did not contain ((embed) all fonts it is using and therefore the PDF viewer(s) okular / evince just DO NOT DISPLAY certain parts of the document !!!

    Solution below, and worked for me :

    However, it is possible to repair your problematic PDF with the help of Ghostscript. I used this command on a Ubuntu Oneiric system (which uses Ghostscript v9.02) to do this:

    /usr/bin/gs \
    -o gs-repaired---zhang11a.pdf \
    -dPDFSETTINGS=/prepress \
    -sDEVICE=pdfwrite \
    zhang11a.pdf
    The -dPDFSETTINGS=/prepress part of the CLI parameters tell Ghostscript to embed all non-embedded fonts.

    Keep this as a useful reference.

    Reference : http://stackoverflow.com/questions/10277418/the-pdf-viewer-evince-on-linux-can-not-display-some-math-symbols-correctly

Leave a comment

Your email address will not be published. Required fields are marked *