Doc Editor in 20.1.47

Hello

I have just upgraded to the above version.  I have a word document that is loading from a db. It no longer loads.  I see the following in the console:


I load the document on the OnCreated event of the control as shown below.  

Any ideas?

public async void OnCreated(object args)

        {
            await GetTemplate();
            StateHasChanged();
        }


public async Task GetTemplate()
        {
            //Get the data
            var it = await InvoiceTemplateDataService.InvoiceTemplateSelectByTemplateName(AppStateService.CurrentUserEmailAddress, "Default");


            //Using Doc IO open stream. TemplateData is a byte[]
using Stream stream = new MemoryStream(it.TemplateData);
            DocIO.WordDocument document = new DocIO.WordDocument(stream, Syncfusion.DocIO.FormatType.Docx);
            using MemoryStream streamnew = new MemoryStream();
            document.Save(streamnew, Syncfusion.DocIO.FormatType.Docx);


            //Load the stream into a word processing format and throw at the screen
            DocEditor.WordDocument documentnew = DocEditor.WordDocument.Load(streamnew, ImportFormatType.Docx);
            string json = JsonConvert.SerializeObject(documentnew);
            await container.DocumentEditor.Open(json);


        }






7 Replies

SM Suriya Murugan Syncfusion Team April 7, 2022 11:50 AM UTC

Hi Ditchford,


Can you please share the input document which you have tried at your end? that will be helpful for us to analyze further and provide you the solution at the earliest.


Note: If you have any confidential data in your Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face.


Regards,

Suriya M.



DI Ditchford April 7, 2022 12:04 PM UTC

Hello

Please see attached.


Thank you


Attachment: Sample_3d824726.zip


DI Ditchford April 11, 2022 10:02 PM UTC

Hello


Any updates on this please?


Thank you



SM Suriya Murugan Syncfusion Team April 12, 2022 03:46 AM UTC

Apologies for the delay!


We will update details shortly.



AE Ajithamarlin Edward Syncfusion Team April 12, 2022 03:55 PM UTC

Hi Ditchford,


We tried to reproduce the reported issue at our end but we couldn't.


Please check the attached sample for reference.


Please check and let is know whether you are able to reproduce the reported issue from the shared sample.


If you still facing the issue, Please let us know whether your are using CDN link or min.js link in the layout.cshtml file as source.




Regards,

Ajithamarlin E



Attachment: SyncfusionBlazorApp1_a93ee13c.zip


DI Ditchford April 13, 2022 09:59 AM UTC

Hey  Ajithamarlin 


Thank you for that.  So essentially the control has changed from using Newtsoft to System.Text.Json.  I see now that its in the release notes.  

Got to say I did a bit of an eye-roll when I saw it was a breaking change, however it was an easy fix with the help of your sample and now I am absolutely blown away by the performance improvment.


Don't know whether this is is to do with System.Text.Json or the change in in the default value of IgnoreScriptIsolation is this volume.  Either way, I couldn't be happier with the performance improvement.  My documents render pretty much instantly...wow...just wow.


Nice work...thank you.




SM Suriya Murugan Syncfusion Team April 20, 2022 03:46 AM UTC

Hi Ditchford,



We are glad to know that your issue gets resolved. Please let us know if you need any further assistance.




Regards,

Suriya M.




Loader.
Up arrow icon