Converting RTF document to HTML using HtmlFormatProvider and headers and footers are missing in the HTML

1 Answer 695 Views
General Discussions
Duleepa
Top achievements
Rank 1
Duleepa asked on 01 Dec 2021, 10:03 AM | edited on 02 Dec 2021, 03:28 AM

When I run my application which converts RTF documents to HTML content, I get an HTML output without the footer and the header part. It seems that HtmlFormatProvider does not support exporting header and footers from RTF documents.

Is there any other way to do this conversion? or is this something that would be considered in the future?

using Telerik.Windows.Documents.Flow.FormatProviders.Html;
...

var
htmlProvider = new HtmlFormatProvider();
html = htmlProvider.Export(rtfDocument);

 

 

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 03 Dec 2021, 02:52 PM

Hello Duleepa,

The behavior you see is related to the specifics of the different formats. The HTML specification doesn't define a concept for headers and footers, nor for pages. That is why these elements are not supported when exporting to HTML. The same behavior can be also observed if you try to convert the document using MS Word.

Hope this information is helpful.

Regards,
Tanya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Duleepa
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or