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

Unreadable content in generated document, by using .asImage() plus some footer elements #462

Open
nheuermann opened this issue Apr 21, 2022 · 3 comments

Comments

@nheuermann
Copy link

nheuermann commented Apr 21, 2022

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

If I generate an M2Doc document with an example like the attached one (minimized to the problematic issue), then a combination of .asImage() and the footer (especially the text box in the footer) leads to a corrupt Word document. Can be fixed by Word when opening, but that’s annoying. The visible content is then as expected.

If you remove either the asImage() service usage or the text box, it works fine.

Note: I had difficulties identifying the problematic element from the footer, which originally had more elements - sometimes even the black background picture was enough to cause the issue. So it’s not limited to a textbox itself. I could provide more examples, if needed.

Expected behavior

Generation of a Word document, which is not corrupt.

Minimal reproduction of the problem with instructions

  1. Use the attached template and assign a valid e.g. .png file path to the variable before .asImage()
    Note that we use m2doc programmatically with our EMF based tool, so "'../../'.concat(myExternalDocumentPicture.uri)" might have to be adapted when using another Eclipse tool.
  2. Generate the document
  3. Word opens and says that it found "unreadable content" (screenshot in the template file).

What is the motivation / use case for changing the behavior?

Correct the behaviour. Identifying the problematic combination of m2doc commands and other template elements is difficult, as there is no error message.

Environment


M2Doc version: 3.2.0
Eclipse version: not fully sure, as our tool is built with Eclipse (but not by me). If needed, I can find out (which Eclipse library/part is important?)
Platform version:  Windows 11
Office: MS Word 365

Others:

Files:
minimal_example.docx
minimal_example.output.docx

@ylussaud
Copy link
Collaborator

The use of text areas in header/footer is a known limitation of M2Doc (see #312). For the moment a workaround can be to replace the text area with something else: table or some text with pagination.

@nheuermann
Copy link
Author

Hi Yvan,
Ok, thanks. Sorry for obviously not searching thoroughly enough before.

You can probably close this issue as a duplicate.

Regards,
Nils

@ylussaud
Copy link
Collaborator

Don't worry, the terminology is not very clear and you provided a test case so thank you very much.

I will leave it open for the moment. This issue is a bit tricky since it imply changing the parser of M2Doc, so I'm not sure when we will address it.

@ylussaud ylussaud added this to the 3.2.3 milestone Sep 16, 2022
@ylussaud ylussaud modified the milestones: 3.3.0, 3.3.1 May 2, 2023
@ylussaud ylussaud modified the milestones: 3.3.1, 3.3.2 Sep 19, 2023
@ylussaud ylussaud modified the milestones: 3.3.2, 3.3.3 Dec 4, 2023
@ylussaud ylussaud removed this from the 3.3.3 milestone Sep 11, 2024
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