I am creating a document with HTML text as given in the attachment (test.txt).
Requirments:
I need to retain the indentation of the text.
I need to have the text justified.
I need to remove the space after the text.
And If need to retain the bullet style.
Current Code used :
String clauseText = clause.getClauseHTMLText();
clauseText = clauseText + “\r”;
builder.getParagraphFormat().setStyle(listStyleLevel1);
// builder.getListFormat().setList(list);
builder.getListFormat().setListLevelNumber(2);
builder.getFont().setSize(12);
builder.getFont().setName(“Calibri”);
builder.getFont().setBold(false);
builder.getParagraphFormat().setAlignment(ParagraphAlignment.JUSTIFY);
// builder.getParagraphFormat().setLeftIndent(0);
// builder.getParagraphFormat().setRightIndent(0);
builder.getParagraphFormat().setSpaceAfter(0);
// builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.NORMAL);
clauseText = clauseText.replaceAll(“font-family:”, “”);
clauseText = clauseText.replaceAll(“font-size:”, “”);
clauseText = clauseText.replaceAll(“text-align: center”, “”);
clauseText = clauseText.replaceAll(“text-align: left”, “”);
clauseText = clauseText.replaceAll(“text-align: justify”, “”);
clauseText = clauseText.replaceAll(“text-justify: inter-ideograph”, “”);
clauseText = clauseText.replaceAll(“text-indent: -”, "text-indent: “);
clauseText = clauseText.replaceAll(”
", “”);
builder.insertHtml(clauseText);
builder.getFont().clearFormatting();
Iterating through this code and writing in doc para by para.
Currently I am getting the document as in test.doc.
I am unable to get the formatting as requirements.