[Example] StyleTemplates (real styles)
Posted: Sun Jul 09, 2017 2:05 pm
Information in this thread will be useful if you want to generate documents having "real styles" (like in Microsoft Word or other text processor), or if you want using "real styles" without RichViewActions.
If you use RichViewActions, and documents are created by users, RichViewActions do all the necessary work.
Introduction
In our component, the collection of StyleTemplates (I'll abbreviate them as "ST") represents "real styles".
ST do not affect document appearance directly. Instead, they allow changing collections of TextStyles and ParaStyles, which represent text and paragraph attributes.
There are 3 types of "ST" (see Kind property):
- text ST (can be linked to items in TextStyles)
- paragraph ST (can be linked to items in ParaStyles)
- text+paragraph ST (can be linked to the both of them).
If ST is linked to a paragraph, it affects both paragraph and text inside this paragraph.
It's highly recommended to link each item in ParaStyles to some ST. Linking items of TextStyles to some ST is optional.
Items in StyleTemplates are named (see Name property) . You can use any names, but make sure that they are unique in the collection.
However, several names are special.
It's highly recommended use the name "Normal" for the default paragraph ST (like MS Word does). TRichView makes sure that "Normal" ST is paragraph ST.
It's recommended to use the names "heading 1", "heading 2", ... "heading 9" for ST representing headings. However, it's not a name that makes a heading from the paragraph, but OutlineLevel property of items of ParaStyles.
It's highly recommended to use the name 'Hyperlink' for ST representing hyperlinks. However, it's not a name that makes a hyperlink from text, but Jump property of items of TextStyles.
Additional info:
http://www.trichview.com/help/styles_an ... lates.html
If you use RichViewActions, and documents are created by users, RichViewActions do all the necessary work.
Introduction
In our component, the collection of StyleTemplates (I'll abbreviate them as "ST") represents "real styles".
ST do not affect document appearance directly. Instead, they allow changing collections of TextStyles and ParaStyles, which represent text and paragraph attributes.
There are 3 types of "ST" (see Kind property):
- text ST (can be linked to items in TextStyles)
- paragraph ST (can be linked to items in ParaStyles)
- text+paragraph ST (can be linked to the both of them).
If ST is linked to a paragraph, it affects both paragraph and text inside this paragraph.
It's highly recommended to link each item in ParaStyles to some ST. Linking items of TextStyles to some ST is optional.
Items in StyleTemplates are named (see Name property) . You can use any names, but make sure that they are unique in the collection.
However, several names are special.
It's highly recommended use the name "Normal" for the default paragraph ST (like MS Word does). TRichView makes sure that "Normal" ST is paragraph ST.
It's recommended to use the names "heading 1", "heading 2", ... "heading 9" for ST representing headings. However, it's not a name that makes a heading from the paragraph, but OutlineLevel property of items of ParaStyles.
It's highly recommended to use the name 'Hyperlink' for ST representing hyperlinks. However, it's not a name that makes a hyperlink from text, but Jump property of items of TextStyles.
Additional info:
http://www.trichview.com/help/styles_an ... lates.html