- Code: Select all
Paragraph para = sec.addParagraph();
para.appendHTML(content));
之后有方法 可以设置这个段落中内容的 段前段后3磅,首行缩进2字符,多倍行距1.4倍吗?
Paragraph para = sec.addParagraph();
para.appendHTML(content));
Document doc = new Document();
Section section = doc.addSection();
Paragraph para = section.addParagraph();
para.appendHTML("<p>非常感谢您使用我们的 Spire.PDF for .NET 产品。试用版除了会在生成的结果文档中添加红色水印,而且仅支持转换前 10 页到其它格式。当您购买并应用 license 后,会成功移除这些水印信息并解除功能限制。</p>");
//设置段前段后为“3磅”
para.getFormat().setBeforeAutoSpacing(false);
para.getFormat().setBeforeSpacing(3);
para.getFormat().setAfterAutoSpacing(false);
para.getFormat().setAfterSpacing(3);
//设置多倍行距为1.4倍
para.getFormat().setLineSpacingRule(LineSpacingRule.Multiple);
para.getFormat().setLineSpacing(1.4f);
doc.saveToFile("output/result_beforeAfter.docx", FileFormat.Docx);