(3.0.9.1 - March 27th, 2009)


Manual for HTML-to-RTF Pro DLL .Net
- pure C# component to convert HTML to Word, HTML to DOC, HTML to RTF, HTML to Text. Works with strings and 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:
 Console app - C#
 Console app - VB
 ASP.Net - C#
 ASP.Net - VB
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
             
 
© Copyright SautinSoft™ 2002 - 2009