Disable optimized text measuring in Blazor DocumentEditor component

21 Feb 20221 minute to read

Starting from v19.3.0.x, the accuracy of text size measurements in Document editor is improved such as to match Microsoft Word pagination for most Word documents. This improvement is included as default behavior along with an optional API EnableOptimizedTextMeasuring in Document editor settings.

If you want the Blazor Word Processor component (a.k.a Document Editor) component to retain the document pagination (display page-by-page) behavior like v19.2.0.x and older versions. Then you can disable this optimized text measuring improvement, by setting false to EnableOptimizedTextMeasuring property of Blazor Document Editor component.

Disable optimized text measuring in DocumentEditorContainer instance

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

@using Syncfusion.Blazor.DocumentEditor;

<SfDocumentEditorContainer @ref="container" EnableToolbar=true DocumentEditorSettings="settings">
   
</SfDocumentEditorContainer>

@code {

    SfDocumentEditorContainer container;
    // Disable optimized text measuring improvement
    DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { EnableOptimizedTextMeasuring = true };
}

Disable optimized text measuring in DocumentEditor instance

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

@page "/"

@using Syncfusion.Blazor.DocumentEditor;

<SfDocumentEditor IsReadOnly="false" DocumentEditorSettings="settings">
   
</SfDocumentEditor>

@code {
    // Disable optimized text measuring improvement
    DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { EnableOptimizedTextMeasuring = true };
}