HtmlFormatProvider exports valid HTML documents by default. The good news is that we have provided some options to control the Html output which might be just what you need.
HtmlFormatProvider has HtmlExportSettings (accessible through the ExportSettings property) with two options:
DocumentExportLevel - this controls if the the whole Html "Document" will be exported (by default) or just the "Fragment" representing the document body - this option is what you need.
Another option - StylesExportMode controls how styles should be exported. If you specify "Classes" (the default value) html will contain Stylesheet blocks and html elements will be assigned class names. The "Inline" option (what you need) will make HtmlFormatProvider to export styles inline for each html element.
You can set this options in code like this:
HtmlExportSettings exportSettings =
exportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
exportSettings.StyleExportMode = StylesExportMode.Inline;
HtmlFormatProvider formatProvider =
formatProvider.ExportSettings = exportSettings;
.. formatProvider.Export(document); ...
I hope this will help.If you have any other questions, do not hesitate to contact us again.
All the best,
the Telerik team
Browse the videos here>>
to help you get started with RadControls for Silverlight