This is a migrated thread and some comments may be shown as answers.

Generate headers, footers and TOC when exported to DocX

3 Answers 388 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ramakrishna
Top achievements
Rank 1
Ramakrishna asked on 06 Nov 2018, 08:42 AM

Hi,

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.

regards,

Rama

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 07 Nov 2018, 09:18 AM
Hi Rama,

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.
0
Ramakrishna
Top achievements
Rank 1
answered on 16 Nov 2018, 08:12 AM

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.
Tags
Editor
Asked by
Ramakrishna
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Ramakrishna
Top achievements
Rank 1
Share this question
or