Hello!
I need to create list with third level with Cyrillic number
1) First level
- Second level
а) Third level
But in ListPatternType there is not such number type.
Could any one help?
// Declare the output file path
String output="output/lists.docx";
// Create a new Document object
Document document = new Document();
// Add a new section to the document
Section sec = document.addSection();
// Create a new ListStyle object with numbered list type
ListStyle numberList = new ListStyle(document, ListType.Numbered);
// Set the name of the list style
numberList.setName("numberList");
// Set the pattern type and number suffix for the first level of the list
numberList.getLevels().get(0).setPatternType(ListPatternType.Low_Letter);
numberList.getLevels().get(0).setNumberSufix(")");
// Add the numberList to the document's list styles
document.getListStyles().add(numberList);
// Add a paragraph to the section
Paragraph paragraph = sec.addParagraph();
// Add another paragraph to the section
paragraph = sec.addParagraph();
// Append text to the second paragraph
paragraph.appendText("List Item 1");
// Apply the numberList style to the second paragraph
paragraph.getListFormat().applyStyle(numberList.getName());
// Save the document to the output file in Docx format
document.saveToFile(output, FileFormat.Docx);