diff --git a/docling/backend/msword_backend.py b/docling/backend/msword_backend.py index 3f235017..3d6df5ac 100644 --- a/docling/backend/msword_backend.py +++ b/docling/backend/msword_backend.py @@ -116,7 +116,9 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend): doc = DoclingDocument(name=self.file.stem or "file", origin=origin) if self.is_valid(): assert self.docx_obj is not None + doc = self.walk_linear(self.docx_obj.sections[0].header._element, self.docx_obj, doc) doc = self.walk_linear(self.docx_obj.element.body, self.docx_obj, doc) + doc = self.walk_linear(self.docx_obj.sections[-1].footer._element, self.docx_obj, doc) return doc else: raise RuntimeError( diff --git a/tests/data/docx/unit_test_formatting.docx b/tests/data/docx/unit_test_formatting.docx index 2b5a0b65..da816467 100644 Binary files a/tests/data/docx/unit_test_formatting.docx and b/tests/data/docx/unit_test_formatting.docx differ