java.lang.Object
com.aspose.words.DocumentBuilderOptions
public class DocumentBuilderOptions
- extends java.lang.Object
Allows to specify additional options for the document building process.
Example:
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");
DocumentBuilderOptions
public DocumentBuilderOptions()
-
|
Property Getters/Setters Detail |
getContextTableFormatting/setContextTableFormatting | |
public boolean getContextTableFormatting() / public void setContextTableFormatting(boolean value)
|
-
True if the formatting applied to table content does not affect the formatting of the content that follows it.
Default value is
true.
Example:
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");
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.