SautinSoft is an Internet-oriented software development company
 

Convert RTF to HTML in VB.Net, Visual Basic

RTF-to-HTML DLL .Net
 
Here you will see how to convert RTF to HTML in VB.Net with help of our component!
 
     
 

This is a first sample how to convert RTF file to HTML file in VB.Net , you will need only two lines of code:

Dim r As New SautinSoft.RtfToHtml()
r.ConvertFile("d:\test.rtf", "d:\test.html")

 

This sample demonstrates how to convert RTF string to HTML string in VB.Net (Visual Basic), it usefull when you don't want to create physical files and work only with memory:

Dim r As New SautinSoft.RtfToHtml()
Dim rtf As String = "{\rtf {\b bold text {\i bold + italic}} and plan text}"
Dim html As String = r.ConvertString(rtf)

 

The component has a lot of properties, for example when you want to export RTF into HTML with images you may save all images as physical files in a single folder or save images inside HTML document.

VB.Net sample how to force the dll store images in folder 'd:\my webs\images':

P.S. the folder 'd:\my webs' must exist, subfolder 'images' will be created by component.

Dim r As New SautinSoft.RtfToHtml()
r.ImageStyle.ImageFolder = "d:\my webs"
r.ImageStyle.ImageSubFolder = "images"
r.ImageStyle.IncludeImageInHtml = False
r.ConvertFile("d:\test.rtf", "d:\test.html")

 

This is a VB.Net sample how to force the dll store images inside HTML document. It's usefull when you want to make RTF converting in memory without creating any files on HDD. Images will be saved inside HTML using base64 algorithm:

Dim r As New SautinSoft.RtfToHtml()
r.ImageStyle.IncludeImageInHtml = True
Dim html As String = r.ConvertFileToString("d:\test.rtf")

 

 

.Net library which add ability to convert RTF to HTML in VB.Net on fly!
 

 

We've showed some samples in VB.Net (Visual Basic) here, but it's only small part of properties and abilities of the SautinSoft.RtfToHtml.dll. The component also can:

  • Convert RTF to XHTML
  • Convert RTF to plain HTML 3.2 and 4.01 with CSS
  • Transform RTF to Text
  • Export Text to HTML

You may also adjust such features using component's properties:

  • Specify image quality, type of image saving
  • Encoding of HTML document
  • Table width and borders
  • Converting only part of document between <body>...</body> tags
  • Auto-detect hyperlinks
  • etc.

Another essential thing in converting of RTF to HTML in VB.Net is a system requirements. Our component requires only .Net 1.1 or higher platform installed. We don't use Internet Explorer or MS Office automation to make component independent and standalone. It's very important thing.

The dll is completely created in C# and works with medium trust level.

Home | Contact | Privacy

Copyright © 2002 - 2010, SautinSoft (started from sautin.com). All rights reserved.