GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    HtmlSaveOptions Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents options for saving to HyperText Markup Language File (HTML) format.

    • C#
    • VB.NET
    public sealed class HtmlSaveOptions : SaveOptions
    Public NotInheritable Class HtmlSaveOptions
        Inherits SaveOptions
    Inheritance:
    System.Object
    SaveOptions
    HtmlSaveOptions

    Constructors

    HtmlSaveOptions()

    Initializes a new instance of the HtmlSaveOptions class.

    • C#
    • VB.NET
    public HtmlSaveOptions()
    Public Sub New

    Properties

    ContentType

    Gets the content-type for HTML file format:

    • message/rfc822 if HtmlType is Mhtml, otherwise
    • "text/html; charset=" + Encoding.System.Text.Encoding.WebName.
    • C#
    • VB.NET
    public override string ContentType { get; }
    Public Overrides ReadOnly Property ContentType As String
    Property Value
    System.String

    The content-type for HTML file format.

    Overrides
    SaveOptions.ContentType

    EmbedImages

    Gets or sets a value indicating whether images are embedded directly within the HTML file in form of Base64 encoding.

    • C#
    • VB.NET
    public bool EmbedImages { get; set; }
    Public Property EmbedImages As Boolean
    Property Value
    System.Boolean
    Remarks

    If the value of this property is true then each image element will contain raw image data in its source attribute. This value doesn't change the pictures export behavior when using Mhtml.

    Encoding

    Gets or sets the encoding for the Html file.

    • C#
    • VB.NET
    public Encoding Encoding { get; set; }
    Public Property Encoding As Encoding
    Property Value
    System.Text.Encoding
    Exceptions
    System.ArgumentNullException

    Value is set to null.

    FilesDirectoryPath

    Gets or sets the physical directory where ExcelPictures and ExcelWorksheets files will be saved.

    • C#
    • VB.NET
    public string FilesDirectoryPath { get; set; }
    Public Property FilesDirectoryPath As String
    Property Value
    System.String

    The physical directory where ExcelPictures and ExcelWorksheets files will be saved.

    Remarks

    If value is null or System.String.Empty and HTML export is called with Save(String) or Save(String, SaveOptions) overload, value will be automatically set to htmlFileNameWithoutExtension + "_files". This directory will be created in the same location as HTML file.

    FilesDirectorySrcPath

    Gets or sets the relative directory that will be used when referencing ExcelPictures and ExcelWorksheets files in the HTML.

    • C#
    • VB.NET
    public string FilesDirectorySrcPath { get; set; }
    Public Property FilesDirectorySrcPath As String
    Property Value
    System.String

    The relative directory that will be used when referencing ExcelPictures and ExcelWorksheets files in the HTML.

    Remarks

    If value is null or System.String.Empty and HTML export is called with Save(String) or Save(String, SaveOptions) overload, value will be automatically set to htmlFileNameWithoutExtension + "_files".

    HtmlType

    Gets or sets the type of export.

    • C#
    • VB.NET
    public HtmlType HtmlType { get; set; }
    Public Property HtmlType As HtmlType
    Property Value
    HtmlType

    The HtmlType value for type of export.

    Remarks

    For Html and HtmlTable values, pictures will be exported only if Save(String) or Save(String, SaveOptions) overload is used or if FilesDirectoryPath is specified or if EmbedImages is set to true.

    For Mhtml value, pictures are always exported.

    Limitations

    Gets limitations for saving to HTML file format.

    • C#
    • VB.NET
    public override FileFormatLimitations Limitations { get; }
    Public Overrides ReadOnly Property Limitations As FileFormatLimitations
    Property Value
    FileFormatLimitations
    Overrides
    SaveOptions.Limitations
    Remarks

    These are the limits:

    • MaxRows: System.Int32.MaxValue
    • MaxColumns: System.Int32.MaxValue
    • MaxColors: System.Int32.MaxValue
    • MaxCellStyles: System.Int32.MaxValue

    SelectionType

    Gets or sets a value indicating whether to save the whole ExcelFile or just ActiveWorksheet.

    • C#
    • VB.NET
    public SelectionType SelectionType { get; set; }
    Public Property SelectionType As SelectionType
    Property Value
    SelectionType

    WriteCellAddress

    Gets or sets a value indicating whether each td HTML element should contain data-cell attribute with cell address for this cell.

    • C#
    • VB.NET
    public bool WriteCellAddress { get; set; }
    Public Property WriteCellAddress As Boolean
    Property Value
    System.Boolean
    Remarks

    If the value of this property is true then each td HTML element will contain data-cell attribute with cell address for this cell (for example data-cell="A1").

    Inherited Properties

    CsvDefault

    Gets the default options for saving to Character Separated Values file format.

    (Inherited from SaveOptions)

    HtmlDefault

    Gets the default options for saving to HyperText Markup Language File format.

    (Inherited from SaveOptions)

    ImageDefault

    Gets the default options for saving to image formats.

    (Inherited from SaveOptions)

    OdsDefault

    Gets the default options for saving to OpenDocument Spreadsheet file format.

    (Inherited from SaveOptions)

    PdfDefault

    Gets the default options for saving to Portable Document Format file.

    (Inherited from SaveOptions)

    TxtDefault

    Gets the default options for saving to Tab delimited file format.

    (Inherited from SaveOptions)

    XlsDefault

    Gets the default options for saving to, XLS file format (Microsoft Excel Spreadsheet format; Excel 2003 and prior versions) .

    (Inherited from SaveOptions)

    XlsbDefault

    Gets the default options for saving to XLSB file format (Microsoft Excel Binary File Format).

    (Inherited from SaveOptions)

    XlsxDefault

    Gets the default options for saving to XLSX file format (Microsoft Excel Open XML Spreadsheet; Excel 2007 and later).

    (Inherited from SaveOptions)

    XpsDefault

    Gets the default options for saving to XML Paper Specification file format.

    (Inherited from SaveOptions)

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.