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

Docx corruption - MS Word new mc:Ignorable w16sdtfl #601

Open
balajiasokkumar opened this issue Nov 22, 2024 · 6 comments
Open

Docx corruption - MS Word new mc:Ignorable w16sdtfl #601

balajiasokkumar opened this issue Nov 22, 2024 · 6 comments

Comments

@balajiasokkumar
Copy link

Hi,

I am facing this issue where, Docx4j generates Corrupted Docx files for Templates authored on newer versions of Microsoft Word.

Templates authored on MS Word Desktop versions until Version 16.90 works
But, Templates authored on MS Word Desktop above Version 16.91 (24091630) generates a corrupted docx file

Error when opening the file on MS Word,
Word found unreadable content in "Testing.docx". Do you want to recover the contents of this document? If you trust the source of this document, click Yes.

Is there anything I need to check?

Thanks

@plutext
Copy link
Owner

plutext commented Nov 25, 2024

What version of docx4j are you using?

Could you please attach a copy of an input docx (ie template authored in Word).

Typically this issue occurs when Microsoft introduces a new namespace prefix into the mc:Ignorable attribute (at the top of document.xml in a docx - unzip it)

@balajiasokkumar
Copy link
Author

Hi,

Thanks a lot for your help here @plutext. I am using docx4j version 11.5.0

Attached is the template I am using,
document-template_NEW2.docx

@plutext plutext changed the title Docx4j generates Corrupted Docx files for Templates authored on newer versions of Microsoft Word Docx corruption - MS Word new mc:Ignorable w16sdtfl Nov 26, 2024
@plutext
Copy link
Owner

plutext commented Nov 26, 2024

Thanks for that.

mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"

w16sdtfl is not yet specified in [MS-DOCX], but now fixed at d92cabb

This will necessitate a v11.5.1 release soon.

@balajiasokkumar
Copy link
Author

Thanks a lot @plutext. This is fantastic!
Would you know when can we expect this release v11.5.1

I am trying to download the template uploaded by the users, and fetch mc:Ignorable and verify if the values only includes the list we support, and not any new outliers.

Do you think that should help us identify any template that is not yet compatible being used?

Thanks a lot for your help and assistance!

@plutext
Copy link
Owner

plutext commented Dec 4, 2024

Released a few days ago:- https://www.docx4java.org/forums/announces/docx4j-11-5-1-8-3-13-released-w16sdtfl-word-update-t3130.html

Yes, that would work. It may be useful to add to docx4j. Automatically fixing is a possibility as well, but would come with a performance cost.

@balajiasokkumar
Copy link
Author

Super!! Thanks a lot @plutext.

I agree with you, it would come with a performance cost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants