public class DocumentBuilderOptions
extends java.lang.Object
Examples:
Shows how to ignore table formatting for content after.
Document doc = new Document();
DocumentBuilderOptions builderOptions = new DocumentBuilderOptions();
builderOptions.setContextTableFormatting(true);
DocumentBuilder builder = new DocumentBuilder(doc, builderOptions);
// Adds content before the table.
// Default font size is 12.
builder.writeln("Font size 12 here.");
builder.startTable();
builder.insertCell();
// Changes the font size inside the table.
builder.getFont().setSize(5.0);
builder.write("Font size 5 here");
builder.insertCell();
builder.write("Font size 5 here");
builder.endRow();
builder.endTable();
// If ContextTableFormatting is true, then table formatting isn't applied to the content after.
// If ContextTableFormatting is false, then table formatting is applied to the content after.
builder.writeln("Font size 12 here.");
doc.save(getArtifactsDir() + "Table.ContextTableFormatting.docx");
| Modifier and Type | Method and Description |
|---|---|
boolean |
getContextTableFormatting()
True if the formatting applied to table content does not affect the formatting of the content that follows it.
|
boolean |
getDesignMode()
Corresponds to Design Mode in Microsoft Word.
|
void |
setContextTableFormatting(boolean value)
True if the formatting applied to table content does not affect the formatting of the content that follows it.
|
void |
setDesignMode(boolean value)
Corresponds to Design Mode in Microsoft Word.
|
public boolean getContextTableFormatting()
true.
Examples:
Shows how to ignore table formatting for content after.
Document doc = new Document();
DocumentBuilderOptions builderOptions = new DocumentBuilderOptions();
builderOptions.setContextTableFormatting(true);
DocumentBuilder builder = new DocumentBuilder(doc, builderOptions);
// Adds content before the table.
// Default font size is 12.
builder.writeln("Font size 12 here.");
builder.startTable();
builder.insertCell();
// Changes the font size inside the table.
builder.getFont().setSize(5.0);
builder.write("Font size 5 here");
builder.insertCell();
builder.write("Font size 5 here");
builder.endRow();
builder.endTable();
// If ContextTableFormatting is true, then table formatting isn't applied to the content after.
// If ContextTableFormatting is false, then table formatting is applied to the content after.
builder.writeln("Font size 12 here.");
doc.save(getArtifactsDir() + "Table.ContextTableFormatting.docx");
boolean value.public void setContextTableFormatting(boolean value)
true.
Examples:
Shows how to ignore table formatting for content after.
Document doc = new Document();
DocumentBuilderOptions builderOptions = new DocumentBuilderOptions();
builderOptions.setContextTableFormatting(true);
DocumentBuilder builder = new DocumentBuilder(doc, builderOptions);
// Adds content before the table.
// Default font size is 12.
builder.writeln("Font size 12 here.");
builder.startTable();
builder.insertCell();
// Changes the font size inside the table.
builder.getFont().setSize(5.0);
builder.write("Font size 5 here");
builder.insertCell();
builder.write("Font size 5 here");
builder.endRow();
builder.endTable();
// If ContextTableFormatting is true, then table formatting isn't applied to the content after.
// If ContextTableFormatting is false, then table formatting is applied to the content after.
builder.writeln("Font size 12 here.");
doc.save(getArtifactsDir() + "Table.ContextTableFormatting.docx");
value - The corresponding boolean value.public boolean getDesignMode()
boolean value.public void setDesignMode(boolean value)
value - The corresponding boolean value.