How can I extract fonts from a PDF file?

42,527

Solution 1

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.

Solution 2

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

Share:
42,527

Related videos on Youtube

slhck
Author by

slhck

Updated on September 17, 2022

Comments

  • slhck
    slhck over 1 year

    Is there a way to extract fonts from PDF files?

    I know that usually embedded fonts in PDF files are only subsets of the fonts. Anyway, is there a way to do this?

    • Grumpy ol' Bear
      Grumpy ol' Bear over 14 years
      Though bear in mind: Some documents with custom fonts are made as PDFs just for the purpose that those fonts should not be available to everybody. Meaning they are copyrighted to their respective owner. Which in turn means if you plan to use said copyrighted font you can get in a lot of trouble. Yes, not every font is free. There are fonts that cost hundreds of buck too.
    • simlev
      simlev almost 7 years
      Uhm...there is an identical question on Stackoverflow that provides a number of solutions. In addition, there appear to be free online services that do this.
    • HackSlash
      HackSlash almost 7 years
      @simlev you appear to have the answer. Why don't you promote your comment to an answer by choosing the best option?