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
Looks like that document uses floating textboxes instead of paragraphs within its headers and footers. There is no API support for those yet in python-docx unfortunately.
If you control these documents you can achieve the same effect with paragraphs and tabs. If not and you just need to read them, you'll need to dig into the XML. You can get a start at seeing what the XML for those currently is with:
print(footer._element.xml)
Then you could possibly use XPath expressions to get the contents or one of some other methods. If you post the XML from one you're interested in I may be able to be more specific.
Hello,
I read that reading footers and headers is available in the latest version of python-docx (https://python-docx.readthedocs.io/en/latest/user/hdrftr.html).
However, when I implement the code below on the attached file (71M6543F-71M6543H.docx
, I get only blanks:
from docx import Document
Reading all footers datasheet:
data_sheet = "D:\CADY\R_D\TestModules\PageNumbers\71M6543F-71M6543H.docx"
word_doc = Document(data_sheet)
for section in word_doc.sections:
Could you please let me know how to fix this issue?
The text was updated successfully, but these errors were encountered: