com.aspose.words

Class BlockImportMode

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

Utility class containing constants. Specifies how properties of block-level elements are imported from HTML-based documents.

Field Summary
static final intMERGE = 0
Properties of parent blocks are merged and stored on child elements (i.e. paragraphs or tables).
static final intPRESERVE = 1
Properties of parent blocks are imported to a special logical structure and are stored separately from document nodes.
 

    • Field Detail

      • MERGE = 0

        public static final int MERGE
        Properties of parent blocks are merged and stored on child elements (i.e. paragraphs or tables).

        Properties of parent blocks are merged as follows: margins are added together; borders of higher-level blocks are discarded and only the most inner-level borders are preserved. As a result, when this mode is specified, some formatting of blocks from the original document will be lost.

        On the other hand, since all merged block-level properties are stored on document nodes, all formating in the resulting document will be available for modification.

      • PRESERVE = 1

        public static final int PRESERVE
        Properties of parent blocks are imported to a special logical structure and are stored separately from document nodes.

        Only margins and borders of 'body', 'div', and 'blockquote' HTML elements are imported. Properties of each HTML element are stored individually.

        This mode allows to better preserve borders and margins seen in the HTML document and get better conversion results. The downside is that the resulting document gets harder to modify, since borders and margins stored in the logical structure are not available for editing.

        This mode mimics MS Word's behavior regarding import of block properties.