Skip to content

Instantly share code, notes, and snippets.

@tiarno
tiarno / gist:8a2995e70cee42f01e79
Last active February 2, 2024 22:15
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.