Click or drag to resize

HtmlElementSizeOutputMode Enumeration

Specifies how Aspose.Words exports element widths and heights to HTML, MHTML and EPUB.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public enum HtmlElementSizeOutputMode
Members
  Member nameValueDescription
All0 All element sizes, both in absolute and relative units, specified in the document are exported.
RelativeOnly1 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.
None2 Element sizes are not exported. Visual agents will build layout automatically according to relationship between elements.
Remarks
Examples
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.LeftIndent = -36;
table.PreferredWidth = PreferredWidth.FromPoints(144);

// When saving to .html, this indent will only be preserved if we set this flag
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.AllowNegativeIndent = true;
options.TableWidthOutputMode = HtmlElementSizeOutputMode.RelativeOnly;

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