use of org.docx4j.wml.R in project docx4j-template by vindell.
the class Docx4J_简单例子2 method addFieldEnd.
public void addFieldEnd(ObjectFactory factory, P paragraph) {
FldChar fldcharend = factory.createFldChar();
fldcharend.setFldCharType(STFldCharType.END);
R run3 = factory.createR();
run3.getContent().add(fldcharend);
paragraph.getContent().add(run3);
}
use of org.docx4j.wml.R in project docx4j-template by vindell.
the class Docx4J_简单例子2 method addPageNumberField.
public void addPageNumberField(ObjectFactory factory, P paragraph) {
R run = factory.createR();
Text txt = new Text();
txt.setSpace("preserve");
txt.setValue("PAGE \\* MERGEFORMAT ");
run.getContent().add(factory.createRInstrText(txt));
paragraph.getContent().add(run);
}
use of org.docx4j.wml.R in project docx4j-template by vindell.
the class Docx4J_简单例子2 method addTotalPageNumberField.
public void addTotalPageNumberField(ObjectFactory factory, P paragraph) {
R run = factory.createR();
Text txt = new Text();
txt.setSpace("preserve");
txt.setValue("NUMPAGES \\* MERGEFORMAT ");
run.getContent().add(factory.createRInstrText(txt));
paragraph.getContent().add(run);
}
use of org.docx4j.wml.R in project docx4j-template by vindell.
the class Docx4j_创建批注_S3_Test method createRunCommentReference.
public R createRunCommentReference(ObjectFactory factory, BigInteger commentId) {
R run = factory.createR();
R.CommentReference commentRef = factory.createRCommentReference();
run.getContent().add(commentRef);
commentRef.setId(commentId);
return run;
}
use of org.docx4j.wml.R 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