HtmlLoadOptions Class
Represents a class that stores loading options for HyperText Markup Language (HTML) format.
public sealed class HtmlLoadOptions : LoadOptions
Public NotInheritable Class HtmlLoadOptions
Inherits LoadOptions
- Inheritance:
- System.ObjectHtmlLoadOptions
Constructors
HtmlLoadOptions()
Initializes a new instance of the HtmlLoadOptions class.
Properties
BaseAddress
Gets or sets the base address for images with relative location.
Property Value
- System.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 System.IO.Stream with Load(Stream, LoadOptions) method and contains images with relative locations.
Encoding
Gets or sets the encoding for the HTML file.
Property Value
- System.Text.Encoding
The encoding for the HTML file.
Exceptions
- System.ArgumentNullException
Value is set to null.
HtmlType
Gets or sets the type of HTML which should be imported.
Property Value
Remarks
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.
public bool InheritCharacterFormat { get; set; }
Public Property InheritCharacterFormat As Boolean
Property Value
- System.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.
public bool InheritParagraphFormat { get; set; }
Public Property InheritParagraphFormat As Boolean
Property Value
- System.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.
public event EventHandler<ResourceLoadingEventArgs> ResourceLoading
Public Event ResourceLoading As EventHandler(Of ResourceLoadingEventArgs)
Event Type
- System.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) |