com.aspose.words

Class HtmlInsertOptions

  • java.lang.Object
    • com.aspose.words.HtmlInsertOptions
public class HtmlInsertOptions 
extends java.lang.Object

Utility class containing constants. Specifies options for the DocumentBuilder.insertHtml(java.lang.String,int) method.

Field Summary
static final intNONE = 0
Use the default options when inserting HTML.
static final intUSE_BUILDER_FORMATTING = 1
Use font and paragraph formatting specified in DocumentBuilder as base formatting for text inserted from HTML.
static final intREMOVE_LAST_EMPTY_PARAGRAPH = 2
Remove the empty paragraph that is normally inserted after HTML that ends with a block-level element.
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        Use the default options when inserting HTML.
      • USE_BUILDER_FORMATTING = 1

        public static final int USE_BUILDER_FORMATTING
        Use font and paragraph formatting specified in DocumentBuilder as base formatting for text inserted from HTML.

        If this option is not specified, formatting of DocumentBuilder is ignored and text is inserted with default HTML formatting. As a result, the text looks as it is rendered in browsers.

        If this option is specified, formatting of inserted text is based on formatting specified in DocumentBuilder, and the text looks as if it were inserted using DocumentBuilder.write(java.lang.String).

      • REMOVE_LAST_EMPTY_PARAGRAPH = 2

        public static final int REMOVE_LAST_EMPTY_PARAGRAPH
        Remove the empty paragraph that is normally inserted after HTML that ends with a block-level element. By default, DocumentBuilder makes sure that the last block-level element imported from HTML is closed after import and inserts a paragraph break after the element. This paragraph break separates content imported from HTML from content of the template document. However, if a HTML fragment is inserted into an empty paragraph, that paragraph break will create an extra empty paragraph. If this behavior is undesired, specify this option.