com.aspose.words

Class HtmlElementSizeOutputMode

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

Utility class containing constants. Specifies how Aspose.Words exports element widths and heights to HTML, MHTML and EPUB.

Example:

Shows how to preserve negative indents in the output .html.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a table and give it a negative value for its indent, effectively pushing it out of the left page boundary
Table table = builder.startTable();
builder.insertCell();
builder.write("Cell 1");
builder.insertCell();
builder.write("Cell 2");
builder.endTable();
table.setLeftIndent(-36);
table.setPreferredWidth(PreferredWidth.fromPoints(144.0));

// When saving to .html, this indent will only be preserved if we set this flag
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.HTML);
options.setAllowNegativeIndent(true);
options.setTableWidthOutputMode(HtmlElementSizeOutputMode.RELATIVE_ONLY);

// The first cell with "Cell 1" will not be visible in the output 
doc.save(getArtifactsDir() + "HtmlSaveOptions.NegativeIndent.html", options);
See Also:
HtmlSaveOptions.TableWidthOutputMode

Field Summary
static final intALL = 0
All element sizes, both in absolute and relative units, specified in the document are exported.
static final intRELATIVE_ONLY = 1
Element sizes are exported only if they are specified in relative units in the document. Fixed sizes are not exported in this mode. Visual agents will calculate missing sizes to make document layout more natural.
static final intNONE = 2
Element sizes are not exported. Visual agents will build layout automatically according to relationship between elements.
 

    • Field Detail

      • ALL = 0

        public static final int ALL
        All element sizes, both in absolute and relative units, specified in the document are exported.
      • RELATIVE_ONLY = 1

        public static final int RELATIVE_ONLY
        Element sizes are exported only if they are specified in relative units in the document. Fixed sizes are not exported in this mode. Visual agents will calculate missing sizes to make document layout more natural.
      • NONE = 2

        public static final int NONE
        Element sizes are not exported. Visual agents will build layout automatically according to relationship between elements.