public class HtmlElementSizeOutputMode
Example:
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);
Field Summary | ||
---|---|---|
static final int | ALL | |
All element sizes, both in absolute and relative units, specified in the document are exported.
|
||
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.
|
||
static final int | NONE | |
Element sizes are not exported. Visual agents will build layout automatically according to relationship between elements.
|
public static final int ALL
public static final int RELATIVE_ONLY
public static final int NONE