-
Notifications
You must be signed in to change notification settings - Fork 139
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
File corruption likely due to duplicate image IDs in document #190
Comments
Hmmm this issue comes to mind #144 . Also, have you tried saving the offending template again in the newest version of Word? Maybe edit it a bit to ensure Word actually parses and serialises it again. That way it may clean up some of the offending xml. Just a shot in the dark. |
Hi Jurriaan, Thanks so much for getting back to me. I had looked at several issues to see if there was something similar & missed the one you referenced. The ID seems to be a really good potential for the issue, so I will give that a try. I am using the latest Word version, but will see how the image ID fix goes (ensuring unique) - I have a feeling that may be it.. |
Hi Jurriaan, I gave this a try & haven't had any success yet, but I am convinced that the ID's mentioned in #144 is the issue. If I allow Word to recover a document, it changes the ID's of the images inserted - so I would imagine it does this for a reason & hence why I think the ID's are the issue. I will revert if I manage to figure this out at some point anyway, appreciate the suggestions. Thanks, Leigh. |
@KAVA-Leigh that sounds interesting and something we can improve docx-templates with. Having pre-existing images in the template seems like a common enough use case. Let me know if you find anything else! |
@KAVA-Leigh did you find any solutions for this? I have exactly the same issue now with existing images on the template. |
Should be fixed in v4.6.2. Will be published to NPM shortly. |
Hi guys,
First of all, I don't think this is actually any issue with the package at all, but have a strange scenario..
We have 2 separate document templates, both of them should be pulling in the same set of images (using
IMAGE
tag)-but in 1 document, the file is perfect, the other always shows the error in Word that the document is corrupted. After letting Word recover it, the document all looks perfect.
So, there seems to be something else in the template that is causing an issue, but, only when the images are inserted (no matter where the image is inserted within the template & no matter what URL is provided). Both documents use the same set of URL's, the same image dimensions & the same
additionalJSContext
function called - so I know it works & has worked for many other templates.Being that it is hard to even reproduce the issue (unfortunately I can't share the template with you in entirety, as it belongs to our customer), I am really just wondering if there are any methods you may know that can help locate the source of the corruption in the document?
Word just magically resolves the issue, but without indication of what it did to fix it & looking at the XML hasn't helped, as I don't really know what I am looking for.
I tried a Microsoft SDK that was suggested online, but I have little/no idea when it comes to .net & I couldn't get it to read the file (probably because I am on Mac), plus I am not really sure if it would have provided the answer for this issue.
Happy for you to just close this off, if there is nothing that comes to mind.
Thanks :)
The text was updated successfully, but these errors were encountered: