RtfToHtmlHtmlFixedSaveOptions Constructor |
Initializes a new instance of the HtmlFixedSaveOptions class.
Namespace: SautinSoftAssembly: SautinSoft.RtfToHtml (in SautinSoft.RtfToHtml.dll) Version: 2024.8.23
Syntax public HtmlFixedSaveOptions()
Example Fixed and Flowing HTML in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using SautinSoft;
namespace Example
{
class Program
{
static void Main(string[] args)
{
FixedAndFlowingHtml();
}
static void FixedAndFlowingHtml()
{
string inpFile = @"..\..\..\example.docx";
string htmlFixedFile = @"Fixed.html";
string htmlFlowingFile = @"Flowing.html";
RtfToHtml r = new RtfToHtml();
try
{
r.Convert(inpFile, htmlFixedFile, new RtfToHtml.HtmlFixedSaveOptions() { Title = "Fixed", PageMargins = 20f });
}
catch (Exception ex)
{
Console.WriteLine($"Conversion failed! {ex.Message}");
}
try
{
r.Convert(inpFile, htmlFlowingFile, new RtfToHtml.HtmlFlowingSaveOptions() { Title = "Flowing"});
}
catch (Exception ex)
{
Console.WriteLine($"Conversion failed! {ex.Message}");
}
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(htmlFixedFile) { UseShellExecute = true });
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(htmlFlowingFile) { UseShellExecute = true });
}
}
}
Fixed and Flowing HTML in VB.Net
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.IO
Imports SautinSoft
Namespace Example
Friend Class Program
Shared Sub Main(ByVal args() As String)
FixedAndFlowingHtml()
End Sub
Private Shared Sub FixedAndFlowingHtml()
Dim inpFile As String = "..\..\..\example.docx"
Dim htmlFixedFile As String = "Fixed.html"
Dim htmlFlowingFile As String = "Flowing.html"
Dim r As New RtfToHtml()
Try
r.Convert(inpFile, htmlFixedFile, new RtfToHtml.HtmlFixedSaveOptions() With {
.Title = "Fixed",
.PageMargins = 20F
})
Catch ex As Exception
Console.WriteLine($"Conversion failed! {ex.Message}")
End Try
Try
r.Convert(inpFile, htmlFlowingFile, New RtfToHtml.HtmlFlowingSaveOptions() With {.Title = "Flowing"})
Catch ex As Exception
Console.WriteLine($"Conversion failed! {ex.Message}")
End Try
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(htmlFixedFile) With {.UseShellExecute = True})
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(htmlFlowingFile) With {.UseShellExecute = True})
End Sub
End Class
End Namespace
See Also