Hi Sampurnima,
Thanks for contacting Syncfusion support.
In our DocumentEditor control, we have some predefined set of styles such as 'Normal', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5', 'Heading 6'. You can apply these styles to selected text by using ‘applyStyle()’ method of Editor module. Please find the sample code to apply predefined styles to selected text.
Sample Code:
//Apply Normal style
documenteditor.editor.applyStyle("Normal");
//Apply Heading 1 style
documenteditor.editor.applyStyle("Heading 1");
//Apply Heading 2 style
documenteditor.editor.applyStyle("Heading 2");
//Apply Heading 3 style
documenteditor.editor.applyStyle("Heading 3");
//Apply Heading 4 style
documenteditor.editor.applyStyle("Heading 4");
//Apply Heading 5 style
documenteditor.editor.applyStyle("Heading 5");
//Apply Heading 6 style
documenteditor.editor.applyStyle("Heading 6"); |
And we also have support for adding custom styles in DocumentEditor. Please find the step to define a new style and apply it in document editor from below documentation link.
Regards,
Suriya M.