public class ExportListLabels
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Use the builder to insert a list
List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
builder.getListFormat().setList(list);
builder.writeln("List item 1.");
builder.getListFormat().listIndent();
builder.writeln("List item 2.");
builder.getListFormat().listIndent();
builder.write("List item 3.");
// When we save this to .html, normally our list will be represented by <li> tags
// We can set this flag to have lists as plain text instead
HtmlSaveOptions options = new HtmlSaveOptions();
{
options.setExportListLabels(ExportListLabels.AS_INLINE_TEXT);
options.setPrettyFormat(true);
}
doc.save(getArtifactsDir() + "HtmlSaveOptions.List.html", options);
Field Summary | ||
---|---|---|
static final int | AUTO | |
Outputs list labels in auto mode. Uses HTML native elements when possible.
|
||
static final int | AS_INLINE_TEXT | |
Outputs all list labels as inline text.
|
||
static final int | BY_HTML_TAGS | |
Outputs all list labels as HTML native elements.
|
public static final int AUTO
public static final int AS_INLINE_TEXT
public static final int BY_HTML_TAGS