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

Exporting the html

0 Answers 41 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 18 Feb 2013, 03:35 PM
I am doing an export of already imported html in radrichtextbox.

I am using it as such:

HtmlFormatProvider htmlFormatProvider = DocumentFormatProvidersManager.GetProviderByExtension("html") as HtmlFormatProvider;
 
HtmlExportSettings htmlExportSettings = new HtmlExportSettings();
htmlExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
htmlExportSettings.StyleRepositoryExportMode = StyleRepositoryExportMode.DontExportStyles;
htmlFormatProvider.ExportSettings = htmlExportSettings;
string html = _htmlFormatProvider.Export(editor.Document);

but it doesn't export my html that i imported in first place e.g.

if i import

<html><head><style>.test{ font-size:50px; }</style></head><body><div class=\"test\"><div style=\"left: 0px; top: 0px; position: absolute;\"> test</div></div></body></html>

I get below html back, when exporting:

<style type="text/css">
p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; } 
body { font-family: 'Verdana';font-style: Normal;font-weight: normal;font-size: 16px; } 
.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; } 
.s_A058BA7C { font-family: 'Times New Roman';font-style: Normal;font-weight: normal;font-size: 50px; } 
</style><p class="p_6AAD5060"><span class="s_A058BA7C">test</span></p>

No answers yet. Maybe you can help?

Tags
RichTextBox
Asked by
Sam
Top achievements
Rank 1
Share this question
or