I would like to generate headers, footers, table of contents etc (headers and footers in each page of the word document) when the editor content is exported to word document format (DocX). Please let me know how to achieve this. Thanks in advance.
RadEditor does not offer a conception for page breaks and thus ability to apply headers and footers.
What you can do is to have different editor's responsible for the different header, body and footer parts of the Word document.
Please find attached an example with three RadEditors on the page: one for the header, one for the footer and one for the body text. The example uses the RadWordsProcessing's HtmlFormatProvider provider to transform the row HTML generated by the editors to flow document and afterwards to DOCX. Therefore, all HTML elements are translated to flow elements. You can find further details about the model utilized in this help article -- RadWordsProcessing | Model | Document Elements.
Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.
Thanks a lot for the reply and sample code. can you also provide an example for generating "Table of contents" in the exported word document (with the option of having our own logic in determining the sections within TOC)?
thanks,
Rama
0
Rumen
Telerik team
answered on 16 Nov 2018, 11:25 AM
Hi Rama,
The content inside RadEditor is a standard string as in a TextBox which does not have dimensions and ending points, thus the concept of pages and therefore ability to build TOC inside RadEditor or in the exported document is not available.
Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.