Handle header and footer

Signed-off-by: SimJeg <sjegou@nvidia.com>
This commit is contained in:
SimJeg 2025-04-01 11:36:47 +02:00
parent 1033c25435
commit 61bd559f78
2 changed files with 2 additions and 0 deletions

View File

@ -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(