Rtf |
The RtfToHtmlHtmlFlowingSaveOptions type exposes the following members.
Name | Description | |
---|---|---|
RtfToHtmlHtmlFlowingSaveOptions | Initializes a new instance of the HtmlFlowingSaveOptions class. |
Name | Description | |
---|---|---|
BuildNavigationPage | Whether to generate a navigation page (like a TOC - table of contents) or not. Default value: true. | |
ContentType |
Gets the content-type for HTML file format.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
CssExportMode |
Specifies how CSS (Cascading Style Sheet) styles are exported to HTML or MHTML.
Default value is Inline.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
CssFileName |
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) | |
CssStream |
Allows to specify the stream where the CSS information will be saved to.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
EmbedImages |
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) | |
Encoding |
Gets or sets the encoding for the HTML file.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
HeadersFootersExportMode | Specifies how headers and footers are output to HTML and MHTML. Default value is PerSection. | |
ImageFormat |
Gets and sets the format to embed images in the saving document. Default value: Auto.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
ImageSavingCallback |
Allows to control how images are saved when a document is saved to HTML.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
ImagesDirectoryPath |
Gets or sets the physical directory where all images will be saved.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
ImagesDirectorySrcPath |
Gets or sets the relative directory that will be used when referencing images in the HTML.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
JpegQuality |
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) | |
KeepCssStreamOpen |
Specifies whether keep the stream open or close it after saving an CSS information.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
ListExportMode | Controls how list labels are output to HTML or MHTML. Default value is Auto. | |
PartSavingCallback | Allows to control how document parts are saved when a document is saved to HTML. | |
ProduceOnlyHtmlBody |
Gets or sets a value to produce a complete HTML document or only between between <body>...</body> tags. Default value: false.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
SingleFontColor |
Sets or gets a single font color for a whole text in the produced HTML document. Default value: null.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
SingleFontFamily |
Sets or gets a single font family for a whole text in the HTML document. Default value: Empty.
(Inherited from RtfToHtmlHtmlSaveOptions) | |
SingleFontSize |
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) | |
SplitCriteria | Specifies how the document should be split when saving to Html format. Default is None. | |
SplitHeadingLevel | Specifies the maximum level of headings at which to split the document. Default value is 2. | |
Title |
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) | |
UseNumericCharacterReference |
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) | |
Version |
Specifies version of HTML standard that should be used when saving the document to HTML or MHTML.
Default value is Xhtml.
(Inherited from RtfToHtmlHtmlSaveOptions) |
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
ToString | Returns a string that represents the current object. (Inherited from Object) |
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 }); } } }
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