Skip to content

HTML to RTF .Net is a standalone .Net class library which gives you methods to convert HTML to RTF, Word and Text documents.

Notifications You must be signed in to change notification settings

SautinSoft/SautinSoft.HtmlToRtf.Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SautinSoft.HtmlToRtf

Nuget versionNuget downloads

SautinSoft.HtmlToRtf

SautinSoft.HtmlToRtf is .NET assembly (SDK) which gives API to convert HTML to DOCX, RTF and Text. Merge and replace text in RTF documents.

Quick links

Top Features

System Requirement

  • .NET Framework 4.6.2 - 4.8
  • .NET 6, 7, 8, 9
  • Windows, Linux, macOS, Android, iOS.

Getting Started with HTML to RTF .Net

Are you ready to give HTML to RTF .NET a try? Simply execute Install-Package sautinsoft.htmltortf from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have HTML to RTF .NET and want to upgrade the version, please execute Update-Package sautinsoft.htmltortf to get the latest version.

Convert HTML to WORD

SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();
string inputFile = @"sample.html";
// You want to save in DOCX.
string outputFile = @"result.docx";
// You want to save in RTF.
string outputFile = @"result.rtf";
h.OpenHtml(inputFile);
h.ToDocx(outputFile);

Merge multiple RTF files

SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();
// Array with several RTF files.
string[] rtfFiles = new string[] { "footer.rtf", "footer.rtf", "footer.rtf" };
string singleRtf = String.Empty;

// Let's divide RTF documents using page break.
h.MergeOptions.PageBreakBetweenDocuments = true;

foreach (string rtfFile in rtfFiles)
	{
        string rtfFilePath = Path.Combine(htmlDir.FullName, rtfFile);

        // Copy 1st RTF to 'singleRtf'
        if (String.IsNullOrEmpty(singleRtf))
            singleRtf = File.ReadAllText(rtfFilePath);

        // Merge 2nd, 3rd ....
        else
            singleRtf = h.MergeRtfString(singleRtf, File.ReadAllText(rtfFilePath));
    }

// Save 'singleRtf' to a file only for demonstration purposes.
string singleRtfPath = Path.Combine(htmlDir.FullName, "single.rtf");
File.WriteAllText(singleRtfPath, singleRtf);

Resources

About

HTML to RTF .Net is a standalone .Net class library which gives you methods to convert HTML to RTF, Word and Text documents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •