Skip to content
Discussion options

You must be logged in to vote

This is what I get:

for b in page.get_text("dict",flags=fitz.TEXTFLAGS_TEXT)["blocks"]:
    for l in b["lines"]:
        for s in l["spans"]:
            print(f"font {s['font']}, text: '{s['text']}'")

            
font TimesNewRomanPSMT, text: 'This is a paragraph in normal style. '
font TimesNewRomanPS-ItalicMT, text: 'This is a paragraph in italic style. '
font TimesNewRomanPS-ItalicMT, text: 'This is a paragraph in oblique style. '
font Helvetica, text: 'This is a paragraph in Helvetica font family. '
font Calibri, text: ' '

Who wrote 1 space char in Calibri?
Blame him!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SirishaGorasa
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
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
Converted from issue

This discussion was converted from issue #1877 on August 17, 2022 14:21.