-
Notifications
You must be signed in to change notification settings - Fork 153
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
Adding a text box inside a for-loop #296
Comments
Sorry for the late reply. Hmm that's weird, but not totally unexpected as there is a lot going on in the XML when you add a text box. Can you try with https://github.com/guigrpa/docx-templates/releases/tag/v4.9.3-beta.2 ? It contains an experimental change to the way the XML is structured when using FOR loops. This release is not on NPM, but you can add it to your |
@jjhbw Thanks for looking into this and the given suggestion. I have tried this beta version and the latest version 4.11. Still the issue is not fixed in both.
This is the shape related XML in converted docx.
With this, I think the issue arises from the new-line syntax conversion on Do you have any idea on this? |
ohh silly me.. No. Its not due to new line syntax change. The reason is an ID duplication on shape related XML Inside <w:drawing> there is a |
Nice find! This is not an easy fix, though, as it would probably require scanning the entire XML tree that has been generated for ID conflicts like this... Or do you think there is another solution? |
Rather scanning the whole XML, isn't it possible to make the change while processing the |
Fixed by #315 |
Hi,
I have tried to put a text-box inside a loop. But after the conversion, I am receiving following "corrupted file" error.
Once clicked yes, the document recovered as expected.
Following is a simple reproducible example.
DOCX-Template - ISSUE - TextBox in for loop.docx
JS code snippet
Following is the expected result.
ISSUE-converted-expected-result.docx
Runtime environment - Node v16.19.0
The text was updated successfully, but these errors were encountered: