Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processing of TOC objects in Word Documents DOCX fails #627

Closed
w0o opened this issue Dec 19, 2024 · 5 comments · Fixed by #853
Closed

Processing of TOC objects in Word Documents DOCX fails #627

w0o opened this issue Dec 19, 2024 · 5 comments · Fixed by #853
Assignees
Labels
bug Something isn't working docx issue related to docx backend

Comments

@w0o
Copy link

w0o commented Dec 19, 2024

Bug

We are seeing an odd behavior where the processing of a TOC table in a word document fails without any errors with the resulting document missing the content that was originally in the TOC.
What we have tried:

  • Using OCR fails with the TOC content being omitted.
  • Exporting to PDF (using Word) and then using docling to convert to markdown works as expected with no content omissions.

Steps to reproduce

Use attached minimal example docx file and run:

docling sample.docx

resulting in the attached Markdown file which has the TOC content missing.

Docling version

Docling version: 2.13.0
Docling Core version: 2.12.1
Docling IBM Models version: 3.1.0
Docling Parse version: 3.0.0

Python version

Python 3.11.11

Note: all shared samples and publicly available documents.
sample.md
sample.docx

@w0o w0o added the bug Something isn't working label Dec 19, 2024
@w0o
Copy link
Author

w0o commented Jan 8, 2025

any updates on this team?

@dolfim-ibm dolfim-ibm added the docx issue related to docx backend label Jan 8, 2025
@maxmnemonic maxmnemonic self-assigned this Jan 8, 2025
@andretost
Copy link

I am seeing the same with one of my documents. The TOC is generated by Word. I have other documents where the TOC is manually added, i.e. with plain text, and that works, of course.

I have experimented with the DocItemLabel labels in the save_to_markdown method. Supposedly, the label DocItemLabel.DOCUMENT_INDEX should cause the ToC to be included, but it doesn't.

@w0o
Copy link
Author

w0o commented Jan 28, 2025

any news on this team? Did we manage to reproduce this and have an idea of what is happening?

@maxmnemonic
Copy link
Contributor

I'm looking into this issue @w0o !

@maxmnemonic
Copy link
Contributor

@w0o @andretost
support for Table Of Contents in docx backend is implemented in this PR: #853

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docx issue related to docx backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants