Property to activate your copy of the component

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

Syntax

      
 C#  Visual Basic 
public string Serial { set; }
Public WriteOnly Property Serial As String

Remarks

The property doesn't work in the trial version, the same as the method SetSerial Use this property only in the full version after purchasing.

Examples

CopySet image folder for properly exporting RTF to HTML string using C#
using System;
using System.IO;
using System.Text;

namespace SampleConvert
{
    class sample
    {
        static void Main(string[] args)
        {
            //NOTE: replace you trial version of RTF-to-HTML DLL .Net library following the steps below.
            // 
            //      1. Remove reference "SautinSoft.RtfToHtml" from your project;
            //      2. Replace the old file "Bin\<.Net version>\SautinSoft.RtfToHtml.dll" 
            //         with the new file from obtained full package (rtftohtml_net_full.zip);
            //      3. Add reference to the "SautinSoft.RtfToHtml.dll" back to your project.
            //        4. Enter serial number here:

            string Serial="01234567890";

            SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
            string AppPath=System.Environment.CurrentDirectory;

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

            //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");
            string htmlFile = Path.Combine(AppPath,"test-registered.html");

            int i = r.ConvertFile(rtfFile,htmlFile);
            if (i == 0)
            {
                System.Console.WriteLine("Converted successfully!");
                System.Diagnostics.Process.Start(htmlFile);
            }
            else
            {
                System.Console.WriteLine("Conversion failed!");
                Console.ReadLine();
            }
        }
    }
}
CopySet image folder for properly exporting RTF to HTML string using VB.Net
Imports System.IO
Imports System.Text

Namespace SampleConvert
    Friend Class sample
        Shared Sub Main(ByVal args() As String)
            'NOTE: replace you trial version of RTF-to-HTML DLL .Net library following the steps below.
            '
            '      1. Remove reference "SautinSoft.RtfToHtml" from your project;
            '      2. Replace the old file "Bin\<.Net version>\SautinSoft.RtfToHtml.dll" 
            '         with the new file from obtained full package (rtftohtml_net_full.zip);
            '      3. Add reference to the "SautinSoft.RtfToHtml.dll" back to your project.
            '        4. Enter serial number here:


            Dim Serial As String = "01234567890"

            Dim r As New SautinSoft.RtfToHtml()
            Dim AppPath As String = System.Environment.CurrentDirectory

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

            '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")
            Dim htmlFile As String = Path.Combine(AppPath, "test-registered.html")

            Dim i As Integer = r.ConvertFile(rtfFile, htmlFile)
            If i = 0 Then
                System.Console.WriteLine("Converted successfully!")
                System.Diagnostics.Process.Start(htmlFile)
            Else
                System.Console.WriteLine("Conversion failed!")
                Console.ReadLine()
            End If
        End Sub
    End Class
End Namespace

See Also