Search in sources :

Example 1 with CommentRangeStart

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));
}
Also used : CommentRangeEnd(org.docx4j.wml.CommentRangeEnd) Comment(org.docx4j.wml.Comments.Comment) R(org.docx4j.wml.R) Text(org.docx4j.wml.Text) CommentRangeStart(org.docx4j.wml.CommentRangeStart) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 CommentRangeEnd (org.docx4j.wml.CommentRangeEnd)1 CommentRangeStart (org.docx4j.wml.CommentRangeStart)1 Comment (org.docx4j.wml.Comments.Comment)1 R (org.docx4j.wml.R)1 Text (org.docx4j.wml.Text)1