Import route return a base64

Hello,


in the synchfusion document Editor, the import docx file was call server side(https://ej2services.syncfusion.com/production/web-services/api/documenteditor/Import ) and return the sfdt format of the word file, but since 2 days it return base 64 format, Here's a stackblitz to test the issues

https://stackblitz.com/edit/fzz5av?file=index.ts


Capture d'écran 2023-10-17 113617.png


1 Reply 1 reply marked as answer

DS Dhanush Sekar Syncfusion Team October 23, 2023 03:05 PM UTC

Hi Omar,


Starting from version v21.1.x, the SFDT file generated in Word Processor component is optimized by default to reduce the file size. All static keys are minified, and the final JSON string is compressed.


Please refer the below code snippet convert new SFDT format to older SFDT format

Client/ServerOld CodeNew Code from v21.1.x
Client-side
var documenteditorContainer = new ej.documenteditor.DocumentEditorContainer();
    var documenteditorContainer = new ej.documenteditor.DocumentEditorContainer({ documentEditorSettings: { optimizeSfdt: false } });
      Server-side C#
      WordDocument sfdtDocument = WordDocument.Load(stream, formatType); string sfdt = Newtonsoft.Json.JsonConvert.SerializeObject(sfdtDocument);
        WordDocument sfdtDocument = WordDocument.Load(stream, formatType); sfdtDocument.OptimizeSfdt = false; string sfdt = Newtonsoft.Json.JsonConvert.SerializeObject(sfdtDocument);
          Server-side Java
          String sfdtDocument = WordProcessorHelper.load(stream, formatType);
            String sfdtDocument = WordProcessorHelper.load(stream, formatType, false);

              Release notes: Essential Studio for EJ2 JavaScript 2023 volume 1 main Release Release Notes (syncfusion.com)

              Documentation link: Optimize sfdt in EJ2 JavaScript Document editor control | Syncfusion


              Regards,

              Dhanush Sekar


              Marked as answer
              Loader.
              Up arrow icon