docling-project / docling-project/docling
How can I extract the content of headers and footers from a DOCX file?
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### I want to extract the content of headers and footers from a DOCX file
Version:2.30.0
I want to extract text in follow place of docx.


Now it only extract main content like:

My extract code is:
```python
ocr_options = RapidOcrOptions(force_full_page_ocr=False)
pdf_pipeline_options = PdfPipelineOptions(artifacts_path=pdf_artifacts_path, ocr_options=ocr_options)
pdf_pipeline_options.do_ocr = True
converter = DocumentConverter(
format_options = {
InputFormat.PDF: PdfFormatOption(pipeline_options=pdf_pipeline_options),
InputFormat.IMAGE: ImageFormatOption(pipeline_options=pdf_pipeline_options),
}
)
source = "header_test.docx"
result = converter.convert(source)
print(result.document.export_to_markdown()) # 输出Markdown
```
Is there any way to help me achieve the recognition of this part of the content? Can it be done through configuration?
...
My test docx is :
[header_test.docx](https://github.com/user-attachments/files/19746582/header_test.docx)
Contributor guide
Assessment
This issue has not been assessed yet.