© Copyright SautinSoft 2002 - 2007
(build 2.0.0 - June 5th, 2007)

Manual for HTML-to-RTF Pro DLL
- .Net component to convert HTML strings (files) to RTF, Text strings (files).
   about | methods and properties | code samples | html samples | faq | order and pricing | support and contacts

Using HTML-to-RTF Pro DLL .Net version in VB.Net and C#

Examples for using DLL in:

 C#
 VB.Net



C# sample - download (0.5 KB)

1. In VisualStudio.net manually add a reference to the Sautin Html-To-Rtf Pro Converter (SautinSoft.HtmlToRtf.dll) via "Add reference" for the current project.

 

3. C# code sample:
using System;
using SautinSoft;
namespace SautinSoftTest
{
    class HtmlToRtfTest
    {
               static void Main(string[] args)
               {
                   string htmlString = "<b>Hello world</b>";
                   string rtfString = "";
               
                   //create object HtmlToRtf converter
                   SautinSoft.HtmlToRtf.Converter h = new SautinSoft.HtmlToRtf.Converter();
                   if (h!=null)
                   {
                       //set converter options
                       h.Serial = "XXXXXXXXX";
                       h.OutputTextFormat = SautinSoft.HtmlToRtf.eOutputTextFormat.Rtf;
               
                       //convert strings
                       rtfString = h.ConvertString(htmlString);
                       System.Console.WriteLine(rtfString);
                       //convert files
                       h.ConvertFile("D:\\Lufthansa.html", "D:\\Lufthansa.rtf");
                   }
               }
    }
}
             
 
 
 

VB.Net sample - download (0.5 KB)

1. In VisualStudio.net manually add a reference to the Sautin Html-To-Rtf Pro Converter (SautinSoft.HtmlToRtf.dll)
via "Add reference" for the current project
.

 

Imports System.IO
Module Module1
 Sub Main()
               Dim strHtml As String
               strHtml = "<p>This is a sample image which stored at d:\images\asterisk.jpg:<br><img border='0' src='images/asterisk.jpg'  width='36' height='35'></p>"
               Dim strRtf As String
               strRtf = ""
               Dim myConverter As SautinSoft.HtmlToRtf.Converter
               myConverter = New SautinSoft.HtmlToRtf.Converter
myConverter.Serial = "XXXXXXXX" myConverter.OutputTextFormat = SautinSoft.HtmlToRtf.eOutputTextFormat.Rtf myConverter.HtmlPath = "d:\" strRtf = myConverter.ConvertString(strHtml) Dim myStreamWriter As StreamWriter Dim strFileLocation As String strFileLocation = "D:\test.rtf" myStreamWriter = New StreamWriter(strFileLocation, False) myStreamWriter.Write(strRtf) myStreamWriter.Close()
               End Sub
End Module