use of org.docx4j.wml.CommentRangeStart in project docx4j-template by vindell.
the class Docx4j_创建批注_S3_Test method createCommentRound.
// 创建批注(选定范围)
public void createCommentRound(ObjectFactory factory, P p, String pContent, String commentContent, RPr fontRPr, RPr commentRPr, BigInteger commentId, Comments comments) throws Exception {
CommentRangeStart startComment = factory.createCommentRangeStart();
startComment.setId(commentId);
p.getContent().add(startComment);
R run = factory.createR();
Text txt = factory.createText();
txt.setValue(pContent);
run.getContent().add(txt);
run.setRPr(fontRPr);
p.getContent().add(run);
CommentRangeEnd endComment = factory.createCommentRangeEnd();
endComment.setId(commentId);
p.getContent().add(endComment);
Comment commentOne = createComment(factory, commentId, "系统管理员", new Date(), commentContent, commentRPr);
comments.getComment().add(commentOne);
p.getContent().add(createRunCommentReference(factory, commentId));
}
Aggregations