-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Hi,
I use the following code snippet to receive the font of words in a word file:
from docx import Document
document = Document('Test_Word.docx')
for paragraph in document.paragraphs:
for run in paragraph.runs:
if run.font:
print ('\n')
print (run.font.name)
print (run.text)
Sorry, I don't know why the code snippet lost the indentation.
In the output, some words break in the middle, for example:
Courier New
u
Courier New
ri
In the example above, 'uri' breaks into 'u' and 'ri'.
Could you please help prevent a word from breaking?
I also attached this word file.
Test_Word.docx
Any comment would be appreciated!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels