How to Disable Optimized Text Measuring in JavaScript DOCX Editor

28 Aug 20261 minute to read

Starting from v19.3.0.x, the accuracy of text size measurements in JavaScript DOCX Editor (Document Editor) is improved to better match Microsoft Word pagination for most Word documents. This improvement is included as the default behavior along with an optional API enableOptimizedTextMeasuring in Document Editor settings.

To retain the document pagination (page-by-page) behavior of v19.2.0.x and older versions, set the enableOptimizedTextMeasuring property of the JavaScript DOCX Editor to false.

Disable Optimized Text Measuring in DocumentEditorContainer Instance

The following example code illustrates how to disable optimized text measuring improvement in the DocumentEditorContainer instance.

var container = new ej.documenteditor.DocumentEditorContainer({
    enableToolbar: true,
    height: '590px'
});

// Disable optimized text measuring improvement
container.documentEditorSettings = { enableOptimizedTextMeasuring: false };

container.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';

container.appendTo('#container');

Disable Optimized Text Measuring in DocumentEditor Instance

The following example code illustrates how to disable optimized text measuring improvement in the DocumentEditor instance.

var documenteditor = new ej.documenteditor.DocumentEditor({ isReadOnly: false, height: '370px', serviceUrl: 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/' });

documenteditor.enableAllModules();

// Disable optimized text measuring improvement
documenteditor.documentEditorSettings = { enableOptimizedTextMeasuring: false };

documenteditor.appendTo('#DocumentEditor');

NOTE

The Web API hosted link https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/ utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.