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

Export Html Headlines

3 Answers 82 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 17 Jul 2015, 09:11 AM

Hi,

we want to use the RichTextBox-Control for an CMS editor.

So we want to use it for creating and formatting texts and converting the XAML in HTML via the HtmlFormatProvider.

​My question is how I've to design a StyleDefinition so that it will be exportetd as headline tag (h1 h2, ... , h6)?

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 22 Jul 2015, 07:53 AM
Hello Sebastian,

The HtmlExportSettings have an option that will export the built-in Heading styles as h1 to h6 tags. Creating a custom style that will be mapped to those tags is not possible, however, as headings in both HTML and DOCX formats have special meta meaning. 

That said, my suggestion would be to set the ExportHeadingsAsTags property of the export settings to true and modify the appearance of the Heading styles to correspond to your needs. It's also possible to change the DisplayName of a style, so the name that is visible in the styles gallery will be different. Could you let me know whether this will fit your scenario?

Regards,
Petya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sebastian
Top achievements
Rank 1
answered on 23 Jul 2015, 07:06 AM

Okay thanks,

 is there realy no way to create Heading styles in code?

0
Petya
Telerik team
answered on 24 Jul 2015, 01:01 PM
Hi Sebastian,

It's completely possible to create a custom style definition with the same characteristics, i.e. a linked style that is shown in the gallery and will be included as an entry when generating a table of contents, and so on. Mapping it to <h1> when exporting to HTML, however, is not possible.

I could log a feature request for this, but am unsure of the scenario that it is needed for.  As a mentioned in my previous reply, those are simply styles with special meta meaning. In fact, I tried creating a custom style in MS Word with the mentioned settings and exporting to HTML just to see if the style will be mapped to a heading in the HTML document, and it doesn't appear to work in that way.

Is modifying the default Heading styles not a feasible option for you? If you could provide a bit more details on the exact needs of your application and the reason you're looking for such customization option, I'll consult with the development team and we will try to propose the best option for you.

Regards,
Petya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Petya
Telerik team
Sebastian
Top achievements
Rank 1
Share this question
or