본문 바로가기
JAVA

아파치 POI RTF 번호매기기

by IT History 2021. 11. 24.
728x90
반응형
RTF 번호매기기

BigInteger bigNumber1 = new BigInteger("0");
BigInteger bigNumber2 = new BigInteger("1");

//setNumID()을 활용해야 글머리에 번호를 매길수있습니다.
XWPFParagraph body1paragraph = document.createParagraph();
XWPFRun body1Text = body1paragraph.createRun();

body1paragraph.setAlignment(ParagraphAlignment.LEFT);
body1paragraph.setNumID(bigNumber1.add(bigNumber2));

body1Text.setText("첫번째 글번호");

//<br>태그
body1Text.addBreak();

XWPFParagraph body2paragraph = document.createParagraph();
XWPFRun body2Text = body2paragraph.createRun();
body2paragraph.setNumID(bigNumber1.add(bigNumber2));
body2Text.setText("두번째 글번호");
                
//<br>태그
body1Text.addBreak();

 

 

결과

728x90
반응형

댓글