Skip to content

List of all font names #458

Answered by samkit-jain
EmanueleGusso asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @EmanueleGusso Appreciate your interest in the library. You may use the following code to get all the fontnames in a PDF

import pdfplumber

pdf = pdfplumber.open("my_file.pdf")

print(set(char["fontname"] for char in pdf.chars))

There's no direct method available to fetch the fontnames so you'll have to go through all the characters and then fetch the fontnames from them using the fontname property in a char object.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@EmanueleGusso
Comment options

@samkit-jain
Comment options

@samkit-jain
Comment options

Answer selected by EmanueleGusso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants