Skip to content

Instantly share code, notes, and snippets.

@zenssh
zenssh / gist:fe8cc625563b53529b4e
Created January 19, 2016 23:01 — forked from tiarno/gist:8a2995e70cee42f01e79
find PDF font info with PyPDF2, example code
from PyPDF2 import PdfFileReader
from pprint import pprint
def walk(obj, fnt, emb):
'''
If there is a key called 'BaseFont', that is a font that is used in the document.
If there is a key called 'FontName' and another key in the same dictionary object
that is called 'FontFilex' (where x is null, 2, or 3), then that fontname is
embedded.