jsvine / pdfplumber

Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables.
MIT License
6.57k stars 659 forks source link

font weight #619

Closed tonystark7cris closed 2 years ago

tonystark7cris commented 2 years ago

For a general use case to differentiate between the heading and the sub section there were several pdfs for which even the bold fonts were giving the same font name and size. Is there any possibilty that we can get font weight so that we can easily differntiate heading with respect to other normal lines.

jsvine commented 2 years ago

Hi @tonystark7cris, and thanks for your interest in this library. Typically, the way to determine font boldness is through the font name. (Sometimes you'll see PDFs imitating boldness by double-printing characters, or other tricks.) Without a specific PDF to reference it's hard to determine what's happening in your case. Are you able to provide an example file, and a pointer to the characters that should be identifiable as bold?

tonystark7cris commented 2 years ago

@jsvine Thank you for your quick response, issue was resolved with font name itself. Thank you for your splendid work.