Set the output format: DOC, RTF, Text ansi or Unicode Text

Namespace:  SautinSoft
Assembly:  SautinSoft.HtmlToRtf (in SautinSoft.HtmlToRtf.dll) Version: 5.8.2.8

Syntax

      
 C#  Visual Basic 
public HtmlToRtf..::.eOutputFormat OutputFormat { get; set; }
Public Property OutputFormat As HtmlToRtf..::.eOutputFormat

Remarks

By default it's set to Rtf.



Examples

CopyHow to convert HTML to Unicode Text file in C#
using System;
using System.IO;
using System.Collections.Generic;
using SautinSoft;

namespace Sample
{
    class Test
    {

        static void Main(string[] args)
        {
            // Convert HTML to Unicode Text file
            // If you need more information about "HTML to RTF .Net" email us at:
            // support[at]sautinsoft.com        
            SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();
            // After purchasing the license, please insert your serial number here to activate the component
            //h.Serial = "XXXXXXXXXXXXXXX";

            DirectoryInfo htmlDir = new DirectoryInfo(@"..\..\..\..\..\..\Testing HTMLs");
            string htmlFile = Path.Combine(htmlDir.FullName, "utf-8.html");
            string textFile = Path.ChangeExtension(htmlFile, ".txt");


            h.OutputFormat = HtmlToRtf.eOutputFormat.TextUnicode;

            int result = h.ConvertFile(htmlFile, textFile);

            if (result==0)
            {
                System.Diagnostics.Process.Start(textFile);
            }
            else
            {
                Console.WriteLine("Converting failed!");
                Console.ReadLine();
            }
        }
    }
}
CopyHow to convert HTML to Unicode Text file in VB.Net
Imports System
Imports System.IO
Imports System.Text

Module Module1
    Sub Main()
        ' Convert HTML to Unicode Text file
        ' If you need more information about "HTML to RTF .Net" email us at:
        ' support[at]sautinsoft.com        
        Dim h As New SautinSoft.HtmlToRtf()
        ' After purchasing the license, please insert your serial number here to activate the component
        'h.Serial = "XXXXXXXXXXXXXXX";


        Dim htmlDir As New DirectoryInfo("..\..\..\..\..\Testing HTMLs")
        Dim htmlFile As String = Path.Combine(htmlDir.FullName, "utf-8.html")
        Dim textFile As String = Path.ChangeExtension(htmlFile, ".txt")


        h.OutputFormat = SautinSoft.HtmlToRtf.eOutputFormat.TextUnicode

        Dim result As Integer = h.ConvertFile(htmlFile, textFile)

        If result = 0 Then
            System.Diagnostics.Process.Start(textFile)
        Else
            Console.WriteLine("Converting failed!")
            Console.ReadLine()
        End If
    End Sub
End Module

See Also