This is a Python wrapper for the PDFFonts command line tool, which provides functionality for working with PDF fonts. The wrapper allows you to quickly list out the fonts in a PDF file along with their properties, such as font name, type, and encoding.
To install the PDFFonts Python wrapper, you can use pip:
pip install pdffonts-pythonfrom pdffonts_python import PDFFonts
# Create an instance of PDFFonts
pdffonts = PDFFonts()
# List fonts in a PDF file
fonts = pdffonts.get_pdf_fonts("example.pdf")
print(fonts)[
{
"name": "AAAAAJ+Connections_Medium_CZEX0A80",
"type": "Type 1C",
"encoding": "Custom",
"embedded": "yes",
"subset": "yes",
"unicode": "yes",
"object": "12",
"id": "0"
},
{
"name": "AAAAAH+ConnectionsIta_CZEX0AC0",
"type": "Type 1C",
"encoding": "Custom",
"embedded": "yes",
"subset": "yes",
"unicode": "yes",
"object": "23",
"id": "0"
}
]This project is licensed under the MIT License. See the LICENSE file for details.