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

Import/Export HTML

1 Answer 562 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
Quop
Top achievements
Rank 1
Quop asked on 12 Jan 2018, 08:28 AM

Hi,

I'm importing  html with RadFlowDocument document = htmlProvider.Import(html);
and exporting with htmlProvider.Export(document, stream);

I have two problems.

1. Why when html (HtmlFormatProvider) is exported, the css class is entered as an element style?
2. Why some elements are automatically added to the class (telerikNormal, TelerikTableNormal etc... I did't declare these classes )?

Can I turn off these options?

 

Many Thanks
Quop

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 16 Jan 2018, 05:20 PM
Hi Quop,

I will get straight to the questions.

1. Why when (HtmlFormatProvider) is exported, the class is entered as an element style?
A similar behavior could be usually observed when the StylesExportMode of HtmlFormatProvider's ExportSetting is set to Inline. However, you didn't mention to have applied similar settings, so I would like to ask you to share a sample HTML content so we can check why the style is exported in the attribute of the element.

2. Why some elements are automatically added to the class (telerikNormal, TelerikTableNormal etc... I declare these classes )?
These classes are the default styles of RadFlowDocument, which are present in any document. They are exported in the HTML to guarantee that the content will look the same way when imported in a rich text editor or opened in a browser.

You can find all the available options for customizing the import and export from/to HTML in the Settings topic for HtmlFormatProvider. To be more specific, the one which could help you achieve the desired behavior is StylesExportMode - when set to None, there will be no additional CSS styling from the default document styles.

Regards,
Tanya
Progress Telerik

Tags
WordsProcessing
Asked by
Quop
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or