How can I extract fonts from a PDF file?

Solution 1:

I would use Font Forge because it is a free, open-source, and cross-platform, solution that can extract font data from PDF files.

https://fontforge.github.io/en-US/

Use the File > Open menu item.

FROM THE DOCUMENTATION:

FontForge can also read (many) fonts out of a pdf file. FontForge usually does not list pdf files (because they aren't really designed as mechanisms for transporting fonts and most such fonts will be incomplete due to subsetting and other optimizations), but you can always type in the name of one directly (or use the [Filter] button to define a filter for pdf files).

https://fontforge.github.io/filemenu.html

Solution 2:

Here I'm promoting my earlier comment to an answer, as per HackSlash's suggestion.

There is an identical question on Stackoverflow that already has an excellent and highly upvoted accepted answer.

It illustrated several methods, which I'll only list briefly:

  1. pdftops
  2. fontforge
  3. mupdf
  4. a ghostscript script
  5. pdf-parser.py

In addition, I'd like to point out that there are several free online services that offer to do just that.

Comment: I am not going to "choose the best option" since best is often subjective and really dependent on the specific situation. Easiest of all would be to use an online service, but that would not be a viable option if the material was to remain private. FontForge looks really good especially for those who might already be using it for font creation or editing. If no desktop environment is available then pdftops (and the other command-line options), would be a good choice also good for automation.