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

“Word found unreadable content” when header contains a shape and an image is inserted for a rich text control #504

Closed
devopsix opened this issue Apr 7, 2022 · 2 comments

Comments

@devopsix
Copy link

devopsix commented Apr 7, 2022

The template DOCX file contains:

  • A shape (a line in this particular) in the header section
  • A rich text content control in the main document part

image

The rich text content control is to be replaced by a paragraph with an image: <p><img src="..."></img></p> (contained in the XML in escaped form).

After binding the content control with docx4j, when opening the resulting document in Word a “Word found unreadable content” error message is shown.

image

The issue goes away as soon as the shape is removed from the template's header section before doing the binding.

Attached is a working sample for reproducing the issue. Extract docx4j-xhtml-image.zip, check out Docx4jXhtmlImageTest.java, run mvn test and open out.docx in MS Word.

@plutext
Copy link
Owner

plutext commented Apr 10, 2022

Thank you for the clear and reproducible issue.

This turns out to be plutext/docx4j-ImportXHTML#71 which I will look at expediting

@plutext plutext closed this as completed Apr 10, 2022
@plutext
Copy link
Owner

plutext commented Apr 17, 2022

Fixed/released in docx4j-ImportXHTML 11.4.6 with docx4j 11.4.6

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