Hi,
Is there option (SpireDoc for java 11.7.0) to set default line spacing for new added/imported from HTML paragraphs, like in MS Word.
Thanks,
Andrei Chorin
// Create a new Document object
Document document = new Document();
// Add a new Section to the document
Section section = document.addSection();
// Create a ParagraphStyle and set its formatting properties
ParagraphStyle paragraphStyle = document.addParagraphStyle("defaultName");
paragraphStyle.getParagraphFormat().setHorizontalAlignment(HorizontalAlignment.Left);
paragraphStyle.getParagraphFormat().setOutlineLevel(OutlineLevel.Body);
paragraphStyle.getParagraphFormat().setFirstLineIndentChars(2);
paragraphStyle.getParagraphFormat().setLeftIndent(0);
paragraphStyle.getParagraphFormat().setLineSpacing(18);
// Get the first paragraph in the section and apply the default style to it, then append HTML content to it
Paragraph paragraph = section.getParagraphs().get(0);
paragraph.applyStyle("defaultName");
paragraph.appendHTML(htmls);
// Add a new paragraph to the section
paragraph = section.addParagraph();
paragraph.applyStyle("defaultName");
paragraph.appendHTML(htmls);
// Save the document to a file with the specified name and format
document.saveToFile("result.docx", FileFormat.Docx_2013);
Document document1 = new Document();
document1.loadFromFile("defaultStyle.docx");
Document document = new Document();
document.loadFromFile("input.docx");
document1.cloneDefaultStyleTo(document);
...