Click or drag to resize

RtfToHtmlHtmlFlowingSaveOptions Class

Represents options for saving to flowing HyperText Markup Language (HTML) format.
Inheritance Hierarchy
SystemObject
  SautinSoftRtfToHtmlHtmlSaveOptions
    SautinSoftRtfToHtmlHtmlFlowingSaveOptions

Namespace: SautinSoft
Assembly: SautinSoft.RtfToHtml (in SautinSoft.RtfToHtml.dll) Version: 2024.8.23
Syntax
public sealed class HtmlFlowingSaveOptions : RtfToHtmlHtmlSaveOptions

The RtfToHtmlHtmlFlowingSaveOptions type exposes the following members.

Constructors
 NameDescription
Public methodCode exampleRtfToHtmlHtmlFlowingSaveOptions Initializes a new instance of the HtmlFlowingSaveOptions class.
Top
Properties
 NameDescription
Public propertyCode exampleBuildNavigationPage Whether to generate a navigation page (like a TOC - table of contents) or not. Default value: true.
Public propertyContentType Gets the content-type for HTML file format.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleCssExportMode Specifies how CSS (Cascading Style Sheet) styles are exported to HTML or MHTML. Default value is Inline.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleCssFileName Specifies the path and the name of the Cascading Style Sheet (CSS) file written when a document is exported to HTML. Default is an empty string.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleCssStream Allows to specify the stream where the CSS information will be saved to.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleEmbedImages Gets or sets a value indicating whether images are embedded directly within the HTML file in form of Base64 encoding. Default value: true.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyEncoding Gets or sets the encoding for the HTML file.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleHeadersFootersExportMode Specifies how headers and footers are output to HTML and MHTML. Default value is PerSection.
Public propertyCode exampleImageFormat Gets and sets the format to embed images in the saving document. Default value: Auto.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleImageSavingCallback Allows to control how images are saved when a document is saved to HTML.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleImagesDirectoryPath Gets or sets the physical directory where all images will be saved.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleImagesDirectorySrcPath Gets or sets the relative directory that will be used when referencing images in the HTML.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleJpegQuality Gets and sets the value indicating Jpeg quality level. Affects only to the images which embedded in Jpeg format. Default value: 90.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleKeepCssStreamOpen Specifies whether keep the stream open or close it after saving an CSS information.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleListExportMode Controls how list labels are output to HTML or MHTML. Default value is Auto.
Public propertyPartSavingCallback Allows to control how document parts are saved when a document is saved to HTML.
Public propertyCode exampleProduceOnlyHtmlBody Gets or sets a value to produce a complete HTML document or only between between <body>...</body> tags. Default value: false.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleSingleFontColor Sets or gets a single font color for a whole text in the produced HTML document. Default value: null.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleSingleFontFamily Sets or gets a single font family for a whole text in the HTML document. Default value: Empty.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleSingleFontSize Sets or gets a single font size in points (pt) for a whole text in the produced HTML document. Default value: null.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleSplitCriteria Specifies how the document should be split when saving to Html format. Default is None.
Public propertyCode exampleSplitHeadingLevel Specifies the maximum level of headings at which to split the document. Default value is 2.
Public propertyCode exampleTitle Gets and sets a title for the generated HTML document. If none is provided, it tries to find an embedded 'title' from the original document. None are found, so it writes "Untitled document". Default: null.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleUseNumericCharacterReference In case of 'true': Write the all characters in "NCR" notation: &#xxx;. In case of 'false': Write the all characters as Unicode (recommended). Default value: false.
(Inherited from RtfToHtmlHtmlSaveOptions)
Public propertyCode exampleVersion Specifies version of HTML standard that should be used when saving the document to HTML or MHTML. Default value is Xhtml.
(Inherited from RtfToHtmlHtmlSaveOptions)
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
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();
        }
        /// <summary>
        /// This sample shows difference between Fixed-HTML and Flowing-HTML.
        /// </summary>
        static void FixedAndFlowingHtml()
        {
            // This file is necessary to get DOCX content as byte array.
            string inpFile = @"..\..\..\example.docx";
            string htmlFixedFile = @"Fixed.html";
            string htmlFlowingFile = @"Flowing.html";

            RtfToHtml r = new RtfToHtml();

            // 1. Convert to HTML-fixed.
            // The HTML in the fixed mode represents HTML document with pages and elements positioned by (x,y).
            try
            {
                r.Convert(inpFile, htmlFixedFile, new RtfToHtml.HtmlFixedSaveOptions() { Title = "Fixed", PageMargins = 20f });
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Conversion failed! {ex.Message}");
            }

            // 2. Convert to HTML-Flowing.
            // The HTML in the flowing mode represents HTML document like a created by a human
            // extended by a whole browser width.
            try
            {
                r.Convert(inpFile, htmlFlowingFile, new RtfToHtml.HtmlFlowingSaveOptions() { Title = "Flowing"});
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Conversion failed! {ex.Message}");
            }


            // Open the results.
            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
        ''' <summary>
        ''' This sample shows difference between Fixed-HTML and Flowing-HTML.
        ''' </summary>
        Private Shared Sub FixedAndFlowingHtml()
            ' This file is necessary to get DOCX content as byte array.
            Dim inpFile As String = "..\..\..\example.docx"
            Dim htmlFixedFile As String = "Fixed.html"
            Dim htmlFlowingFile As String = "Flowing.html"

            Dim r As New RtfToHtml()

            ' 1. Convert to HTML-fixed.
            ' The HTML in the fixed mode represents HTML document with pages and elements positioned by (x,y).
            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

            ' 2. Convert to HTML-Flowing.
            ' The HTML in the flowing mode represents HTML document like a created by a human
            ' extended by a whole browser width.
            Try
                r.Convert(inpFile, htmlFlowingFile, New RtfToHtml.HtmlFlowingSaveOptions() With {.Title = "Flowing"})
            Catch ex As Exception
                Console.WriteLine($"Conversion failed! {ex.Message}")
            End Try


            ' Open the results.
            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