Aspose.words java 分割线

您好,请问一下 aspose.words java是否可以实现在 Word文档 的页眉处添加分割线功能?或者是否有类似的能够出现一条分割线的其他操作方式?

@Changmi,

谢谢你的询问。 请在此处输入您的输入和预期输出Word文档,以供我们参考。 然后,我们将为您提供有关查询的更多信息以及代码。

随机试验随机试验20180816143907.zip (96.7 KB)
您好,附件是我这边想要输出的Word文档,文档的第一页就是我们想要绘制的一个页眉的分割线。请问用aspose的什么方法可以实现加入这个分割线呢?
谢谢

@Changmi,

感谢您分享文档。 请使用Paragraph.ParagraphFormat.Borders.Bottom.LineStyle属性设置段落的下边框。 请检查以下代码示例。 希望这对你有所帮助。

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.getParagraphFormat().getBorders().getBottom().setLineStyle(LineStyle.DOT);
builder.write("run of text with bottom border");

doc.save(MyDir + "out.docx");