Optimize the SFDT file in JavaScript (ES5) DocumentEditor control
08 May 2023 / 2 minutes to read
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. This helps reduce the SFDT file size relative to a DOCX file and provides the following benefits,
File transfer between client and server through the internet gets faster.
The new optimized SFDT files require less storage space than the old SFDT files.
Hence, the optimized SFDT file can’t be directly manipulated as JSON string.
This feature comes with a public API to switch between the old and new optimized SFDT format, allowing backward compatibility.
As a backward compatibility to create older format SFDT files, refer the following code changes,
Client/Server
Old Code
New Code from v21.1.x
Client-side
Copied to clipboard
var documenteditorContainer =newej.documenteditor.DocumentEditorContainer();
Copied to clipboard
var documenteditorContainer =newej.documenteditor.DocumentEditorContainer({ documentEditorSettings:{ optimizeSfdt:false}});