TRVStyle.SaveCSS

<< Click to display table of contents >>

TRVStyle.SaveCSS

Saves text and paragraph styles as CSS (Cascading Style Sheets) file.

type

  TRVSaveCSSOption = (

    rvcssOnlyDifference, rvcssIgnoreLeftAlignment,

    rvcssNoDefCSSStyle, rvcssDefault0Style,

    rvcssMarkersAsText);

  TRVSaveCSSOptions = set of TRVSaveCSSOption;

 

function SaveCSS(const FileName: TRVUnicodeString;

  AOptions: TRVSaveCSSOptions; 

  Encoding: TRVHTMLEncoding): Boolean;

(changed in versions 18 and 21)

Use this method if you want to save content of TRichView as HTML file with external CSS, see TRichView.HTMLSaveProperties.ExternalCSSFileName.

You can save CSS only once and use it for several HTML files (if they are linked to the same or compatible TRVStyle components) .

This method allows reducing size of HTML files.

The following options may be included in the Options parameter.

Option

Meaning

rvcssNoDefCSSStyle

Corresponds to rvcsssoNoDefCSSStyle in TRichView.HTMLProperties.CSSOptions.

It's not recommended to use this option.

rvcssDefault0Style

Properties of TextStyles[0] are not saved. Corresponds to TRichView.HTMLProperties.Default0Style.

rvcssMarkersAsText

Lists will be saved as text.

TRichView.HTMLProperties.ListMarkerSavingType = rvhtmlmstAsText.

Please do not use other options.

There are no methods for loading CSS files, CSS files are loaded and parsed automatically when loading HTML files.

See also:

TRichView working with HTML files.