The start number for CSS styles which will be used in the style name, by default it's 1. For example, <span class="st1">

Namespace:  SautinSoft
Assembly:  SautinSoft.RtfToHtml (in SautinSoft.RtfToHtml.dll) Version: 6.2.2.1

Syntax

      
 C#  Visual Basic 
public int StartCSSNumber { get; set; }
Public Property StartCSSNumber As Integer

Remarks

Default value: 1.

Examples

CopySet start number to style class names in HTML using C#
using System;
using System.IO;
using System.Text;

namespace SampleConvert
{
    class sample
    {
        static void Main(string[] args)
        {
            SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
            string AppPath=System.Environment.CurrentDirectory;

            //specify some options
            r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_401;
            r.Encoding = SautinSoft.RtfToHtml.eEncoding.UTF_8;

            //specify image options
            r.ImageStyle.ImageFolder = AppPath;            //this folder must exist
            r.ImageStyle.ImageSubFolder = "test.files";    //this folder will be created by the component
            r.ImageStyle.ImageFileName = "img";            //template name for images
            r.ImageStyle.IncludeImageInHtml = false;    //false - save images on HDD, true - save images inside HTML

            string rtfFile = Path.GetFullPath(@"..\..\..\..\..\test.rtf");

            //1. Converting test file with inline CSS
            r.TextStyle.InlineCSS = true; // Make all styles inline

            string htmlFile = Path.Combine(AppPath,"test-inline.html"); //the result will be located in the same folder as binary
            int i = r.ConvertFile(rtfFile,htmlFile);
            if (i==0)
            {
                System.Console.WriteLine("Test file 1 converted successfully!");
                System.Diagnostics.Process.Start(htmlFile);
            }
            else
                System.Console.WriteLine("Test file 1 conversion failed!");


            //2. Converting test file with class name prefix and start number = 50
            r.TextStyle.InlineCSS = false; // Turn off inline styles
            r.TextStyle.StyleName = "customcorporate";
            r.TextStyle.StartCSSNumber = 51; //considering that first 50 styles are reserved

            htmlFile = Path.Combine(AppPath,"test-prefix-numeration.html");
            i = r.ConvertFile(rtfFile,htmlFile);
            if (i==0)
            {
                System.Console.WriteLine("Test file 2 converted successfully!");
                System.Diagnostics.Process.Start(htmlFile);
            }
            else
                System.Console.WriteLine("Test file 2 conversion failed!");
        }
    }
}
CopySet start number to style class names in HTML using VB.Net
Imports System.IO
Imports System.Text

Namespace SampleConvert
    Friend Class sample
        Shared Sub Main(ByVal args() As String)
            Dim r As New SautinSoft.RtfToHtml()
            Dim AppPath As String = System.Environment.CurrentDirectory

            'specify some options
            r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_401
            r.Encoding = SautinSoft.RtfToHtml.eEncoding.UTF_8

            'specify image options
            r.ImageStyle.ImageFolder = AppPath 'this folder must exist
            r.ImageStyle.ImageSubFolder = "test.files" 'this folder will be created by the component
            r.ImageStyle.ImageFileName = "img" 'template name for images
            r.ImageStyle.IncludeImageInHtml = False 'false - save images on HDD, true - save images inside HTML


            Dim rtfFile As String = Path.GetFullPath("..\..\..\..\..\test.rtf")

            '1. Converting test file with inline CSS
            r.TextStyle.InlineCSS = True ' Make all styles inline


            Dim htmlFile As String = Path.Combine(AppPath, "test-inline.html") 'the result will be located in the same folder as binary
            Dim i As Integer = r.ConvertFile(rtfFile, htmlFile)
            If i = 0 Then
                System.Console.WriteLine("Test file 1 converted successfully!")
                System.Diagnostics.Process.Start(htmlFile)
            Else
                System.Console.WriteLine("Test file 1 conversion failed!")
            End If


            '2. Converting test file with class name prefix and start number = 50
            r.TextStyle.InlineCSS = False ' Turn off inline styles
            r.TextStyle.StyleName = "customcorporate"
            r.TextStyle.StartCSSNumber = 51 'considering that first 50 styles are reserved


            htmlFile = Path.Combine(AppPath, "test-prefix-numeration.html")
            i = r.ConvertFile(rtfFile, htmlFile)
            If i = 0 Then
                System.Console.WriteLine("Test file 2 converted successfully!")
                System.Diagnostics.Process.Start(htmlFile)
            Else
                System.Console.WriteLine("Test file 2 conversion failed!")
            End If
        End Sub
    End Class
End Namespace

See Also