I try to open a file from a URL, so I follow this Tutorial. The problem now is every time I try to open the file, I get the following error.
I also made a test with a simple file (text.txt) which only contains “Hello world”. In that case, is the response from asp.net:
"{\"sections\":[{\"blocks\":[{\"inlines\":[{\"text\":\"Hello \"},{\"text\":\"World\"}]}],\"headersFooters\":{}}],\"background\":{},\"defaultTabWidth\":0.0,\"formatting\":false,\"trackChanges\":false,\"protectionType\":\"ReadOnly\",\"enforcement\":false,\"dontUseHTMLParagraphAutoSpacing\":false,\"alignTablesRowByRow\":false,\"footnotes\":{},\"endnotes\":{},\"compatibilityMode\":\"Word2003\",\"allowSpaceOfSameStyleInTable\":false}"
This looks to me correct, so I think the issue is in the editor itself. I use local exact the same code as in the Tutorial.
I use the following package Versions:
@angular/xxx: 15.1.4
@syncfusion/ej2-angular-documenteditor: 20.4.50
Thanks for the help.
Hi Alex,
we have checked the reported issue by opening a SFDT you have shared. we are unable to reproduce the issue with the provided details. we have shared a modified SFDT file and a simple sample with the default opening of the file contains “Hello world”. you can cross-check that at your end.
And we suspect that the reported problems are might be due to the contents in the input word (error you have shared) document which used at your end. We need to investigate with the contents in your input Word document to reproduce the exact problem at our end. So, could you please provide us the input Word document which used at your end and share the details of issue if you faced any in console. Thereby, we will analyze further and provide you the appropriate solution at the earliest.
Sample Link: https://stackblitz.com/edit/angular-hnhpz8-51dkcz?file=src%2Fdata.ts,src%2Fapp.component.ts,package.json
Regards,
Kavitha M
Hi Kavitha,
Thanks for the example from the SFDT file, that helped me a lot. I figured out that the problem in my code was that I need to parse the “responseText” like that:
this.container.documentEditor.open(JSON.parse(http.responseText));
Regards,
Alex
You're welcome, Alex.
We are happy to hear that the provided information helped you to resolve the issue. Please get back to us if you need any other assistance.
NOTE: If that post is helpful, please consider accepting it as the answer so that other members can locate it more quickly.