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

    Show / Hide Table of Contents

    HtmlLoadOptions Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents a class that stores loading options for HyperText Markup Language (HTML) format.

    • C#
    • VB.NET
    public sealed class HtmlLoadOptions : LoadOptions
    Public NotInheritable Class HtmlLoadOptions
        Inherits LoadOptions
    Inheritance:
    Object
    LoadOptions
    HtmlLoadOptions

    Constructors

    HtmlLoadOptions()

    Initializes a new instance of the HtmlLoadOptions class.

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

    Properties

    BaseAddress

    Gets or sets the base address for images with relative location.

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

    The base address for images with relative location.

    Remarks

    Images with relative location such as <img src="Pictures/MyPicture.jpg"/> or <img src="../../Pictures/MyPicture.jpg"/> are read based from BaseAddress or path parameter if Load(String) or Load(String, LoadOptions) method is used.

    This property is useful if HTML document is loaded from Stream with Load(Stream, LoadOptions) method and contains images with relative locations.

    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
    Encoding

    The encoding for the HTML file.

    Exceptions
    ArgumentNullException

    Value is set to null.

    HtmlType

    Gets or sets the type of HTML which should be imported.

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

    The HtmlType value for the type of HTML which should be imported.

    Remarks

    Valid HTML types when importing are Html and Mhtml.

    InheritCharacterFormat

    Gets or sets a value indicating whether the character format should be inherited from the position where the HTML is being inserted.

    The default value is false.

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

    This property is currently used only when loading HTML with ContentRange.LoadText(String, HtmlLoadOptions) and ContentPosition.LoadText(String, HtmlLoadOptions) methods and is ignored when loading the whole HTML file using DocumentModel.Load(String) methods.

    InheritParagraphFormat

    Gets or sets a value indicating whether the paragraph format should be inherited from the position where the HTML is being inserted.

    The default value is false.

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

    This property is currently used only when loading HTML with ContentRange.LoadText(String, HtmlLoadOptions) and ContentPosition.LoadText(String, HtmlLoadOptions) methods and is ignored when loading the whole HTML file using DocumentModel.Load(String) methods.

    Events

    ResourceLoading

    Occurs when external resources, like images and style sheets, are being loaded and can be used to customize the retrieving of linked resources.

    • C#
    • VB.NET
    public event EventHandler<ResourceLoadingEventArgs> ResourceLoading
    Public Event ResourceLoading As EventHandler(Of ResourceLoadingEventArgs)
    Event Type
    EventHandler<ResourceLoadingEventArgs>

    Inherited Properties

    DocDefault

    Gets the default loading options for Microsoft Word 97-2003 (DOC) format.

    (Inherited from LoadOptions)

    DocxDefault

    Gets the default loading options for Microsoft Word (DOCX) format.

    (Inherited from LoadOptions)

    HtmlDefault

    Gets the default loading options for HyperText Markup Language (HTML) format.

    (Inherited from LoadOptions)

    OdtDefault

    Gets the default loading options for Open Document (ODT) format.

    (Inherited from LoadOptions)

    PdfDefault

    Gets the default loading options for Portable Document Format (PDF).

    (Inherited from LoadOptions)

    PreserveUnsupportedFeatures

    Gets or sets a value indicating whether to preserve file format features that are not directly supported through GemBox.Document object model.

    (Inherited from LoadOptions)

    RtfDefault

    Gets the default loading options for Rich Text (RTF) format.

    (Inherited from LoadOptions)

    TxtDefault

    Gets the default loading options for Plain Text (TXT) format.

    (Inherited from LoadOptions)

    XmlDefault

    Gets the default loading options for XML file format.

    (Inherited from LoadOptions)

    Examples

    Convert between Word files and HTML pages in C# and VB.NET
    Convert Word and HTML to PDF in C# and VB.NET

    See Also

    HtmlDefault
    Load(String, LoadOptions)
    Load(Stream, LoadOptions)
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.