public class TxtListIndentation
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Create a list with three levels of indentation
builder.getListFormat().applyNumberDefault();
builder.writeln("Item 1");
builder.getListFormat().listIndent();
builder.writeln("Item 2");
builder.getListFormat().listIndent();
builder.write("Item 3");
// Microsoft Word list objects get lost when converting to plaintext
// We can create a custom representation for list indentation using pure plaintext with a SaveOptions object
// In this case, each list item will be left-padded by 3 space characters times its list indent level
TxtSaveOptions txtSaveOptions = new TxtSaveOptions();
txtSaveOptions.getListIndentation().setCount(3);
txtSaveOptions.getListIndentation().setCharacter(' ');
doc.save(getArtifactsDir() + "TxtSaveOptions.TxtListIndentation.txt", txtSaveOptions);
Constructor Summary |
---|
Property Getters/Setters Summary | ||
---|---|---|
char | getCharacter() | |
void | setCharacter(charvalue) | |
Gets or sets which character to use for indenting list levels. The default value is '\0', that means there is no indentation. | ||
int | getCount() | |
void | setCount(intvalue) | |
Gets or sets how many |
public char getCharacter() / public void setCharacter(char value)
Example:
Shows how to configure list indenting when converting to plaintext.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Create a list with three levels of indentation builder.getListFormat().applyNumberDefault(); builder.writeln("Item 1"); builder.getListFormat().listIndent(); builder.writeln("Item 2"); builder.getListFormat().listIndent(); builder.write("Item 3"); // Microsoft Word list objects get lost when converting to plaintext // We can create a custom representation for list indentation using pure plaintext with a SaveOptions object // In this case, each list item will be left-padded by 3 space characters times its list indent level TxtSaveOptions txtSaveOptions = new TxtSaveOptions(); txtSaveOptions.getListIndentation().setCount(3); txtSaveOptions.getListIndentation().setCharacter(' '); doc.save(getArtifactsDir() + "TxtSaveOptions.TxtListIndentation.txt", txtSaveOptions);
public int getCount() / public void setCount(int value)
Example:
Shows how to configure list indenting when converting to plaintext.Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Create a list with three levels of indentation builder.getListFormat().applyNumberDefault(); builder.writeln("Item 1"); builder.getListFormat().listIndent(); builder.writeln("Item 2"); builder.getListFormat().listIndent(); builder.write("Item 3"); // Microsoft Word list objects get lost when converting to plaintext // We can create a custom representation for list indentation using pure plaintext with a SaveOptions object // In this case, each list item will be left-padded by 3 space characters times its list indent level TxtSaveOptions txtSaveOptions = new TxtSaveOptions(); txtSaveOptions.getListIndentation().setCount(3); txtSaveOptions.getListIndentation().setCharacter(' '); doc.save(getArtifactsDir() + "TxtSaveOptions.TxtListIndentation.txt", txtSaveOptions);