How can we override the output style of these headings:
And if overriding is not possible, how can we create new headings with custom styles?
Sample output:
I was able to create a new style for paragraph & character but they were not treated as a heading:
And when I try to add table of contents, it was not recognized as a heading:
Hi Deejay,
You can manually override the style by following below steps:
Click manage style options in dropdown.
Dialog will open. Select the style which you want to modify and then click Modify options.
Here, you can change the format based on your requirement and then click ok button.
Now, apply style and respective heading style will apply.
Please let us know whether this satisfied your requirement.
Regards,
Suriya M.
Apologies for the confusion.
So basically we have implemented our own heading dropdown.
And the way we apply heading is using:
document.editorModule.applyStyle('Heading 1'); // If user has selected Heading 1 from the dropdown
Our problem is that, when we do this, text font style for the selected text would automatically be converted to Calibri Light regardless of the font style it has.
We also want that when user selects Heading 1, we can apply our own custom style for heading 1
without the user going through another process of converting that heading's style to something else.
As of now, this is what we are doing:
Unfortunately, the converted text is not recognized as a heading, but just a text with a custom font styles.
@syncfusion/ej2-react-documenteditor v20.1.51
Default character & paragraph format:
Hi Deejay,
We will check and update details shortly.
Regards,
Suriya M.
HI Deejay,
We can able to reproduce the reported issue. Currently, we are validating the issue and get back to you with more details by May 20,2022.
Regards,
Ajithamarlin E
Hi Deejay,
We need additional timeline to check this issue and will update details by May 24, 2022.
Regards,
Suriya M.
HI Deejay,
We have confirmed the reported issue as a defect and logged a defect report. We will fix this issue in our EJ2 patch release which is scheduled for June 14,2022.
You can track the status of the bug through the below feedback link:
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Ajithamarlin E
Hi Deejay,
Sorry for the inconvenience.
We are not possible to include the fix for reported issue in our latest patch release. We will include this fix in our 2022 volume 2 main release which is scheduled for end of June 2022.
You can track the status of the bug through the below feedback link:
Regards,
Suriya M.
Hi Deejay,
Sorry for the inconvenience.
We are not possible to include the fix for reported issue in our 2022 volume 2 main release. We will include this fix in our next EJ2 weekly patch release which is scheduled for July 20, 2022.
Regards,
Ajithamarlin E
Hi
Ajithamarlin Edward,
Btw any updates on this?
Thanks,
Regards,
Deejay
Hi Deejay,
We are glad to announce that our patch release (v20.2.39) is rolled out successfully. In this release, we have added the fix for the reported issue.
Please upgrade to the latest version packages to resolve this issue.
https://www.npmjs.com/package/@syncfusion/ej2-documenteditor
https://www.npmjs.com/package/@syncfusion/ej2-react-documenteditor
Please let us know if you need any further assistance.
Regards,
Suriya M.
Hi
Suriya Murugan,
I just tested this today, the bug was fixed. Thanks
But can you share to us how to override heading styles? or create a custom heading?
I tried this, thinking I can override the styles for heading, but it does not work.
Hi Deejay,
We are checking your requirement and will update details by July 27, 2022.
Regards,
Suriya M.
Hi Deejay,
Please find the Create Style behavior in Document editor.
If you give a new style with same name(name that already exist in the document). We create a unique name for the currently given custom style and return that custom style.
If your need is to have the default styles modified(Heading 1 to Heading 6). Then you can edit the needed style in document editor using the manage style or the MS Word and create a template document use that template document to open by default in the application level.
Please let us know if you need any further assistance.
Regards,
Suriya M.
Hi
Suriya Murugan,
Yes I would like to modify
(Heading 1 to Heading 6). But I would l like to do it through code
Basically our company is implementing our own tool & dropdown for Heading Selection
What I need is to override the default style for Heading 1
so I need to change it through code,
So when the user selects Heading 1,
it would automatically apply the new modified heading style for good user experience
Is there a way you can share a code on how to do this? I cannot find it in your docs.
Hi Deejay,
We will check and update details by August 26, 2022.
Regards,
Suriya M.
Hi Surya Murugan, any updates on this?
Deejay, We are considering this as a feature request. We will implement this and include it in 2023 volume 1 release which is expected on end of March .
Please track the status of this feature from below feedback link: https://www.syncfusion.com/feedback/40286/api-to-modify-the-predefined-styles-in-document-editor
Hi deejay,
we are glad to announce that our patch release (v21.1.37) is rolled out successfully.
In this release, we have included the Feature “API to modify the predefined styles”.
Please upgrade to the latest version packages to use this feature.
NPM Link: (Client-side)
https://www.npmjs.com/package/@syncfusion/ej2-documenteditor
https://www.npmjs.com/package/@syncfusion/ej2-react-documenteditor
NuGet link: (Server-side)
https://www.nuget.org/packages/Syncfusion.Ej2.Wordeditor.ASPNet.Core/
https://www.nuget.org/packages/Syncfusion.Ej2.Wordeditor.ASPNet.MVC5/
Feedback Link: https://www.syncfusion.com/feedback/40286/api-to-modify-the-predefined-styles-in-document-editor
let styleJson: any = { "type": "Paragraph", "name": "Heading 1", "characterFormat": { "fontSize": 32, "fontFamily": "Calibri" } }; documentEditor.editor.createStyle(styleName, true); |
API Reference : https://ej2.syncfusion.com/documentation/api/document-editor/editor/#createstyle
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Kavitha M