You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to open an existing docx with the following code:
from docx import Document
document = Document('Testme.docx')
sections = document.sections
for section in sections:
print(section.start_type)
paragraphs = document.paragraphs
for paragraph in paragraphs:
for run in paragraph.runs:
print(run.text)
if hasattr(run, 'breaks'):
for br in run.breaks:
print(br.type.__name__)
The document has 3 pages (and here I mean 2 manual page breaks) but I can only see the initial NEW_PAGE (2) from the output.
Which is the correct show to find the page breaks?