/** * Add a new {@link XWPFParagraph} to the end of the footnote. * * @param paragraph CTP paragraph from which to construct the {@link XWPFParagraph} * @return The added {@link XWPFParagraph} */ public XWPFParagraph addNewParagraph(CTP paragraph) { CTP newPara = ctFtnEdn.addNewP(); newPara.set(paragraph); XWPFParagraph xPara = new XWPFParagraph(newPara, this); paragraphs.add(xPara); return xPara; }
/** * Appends a new {@link XWPFParagraph} to this footnote. * * @return The new {@link XWPFParagraph} * @since 4.0.0 */ public XWPFParagraph createParagraph() { XWPFParagraph p = new XWPFParagraph(this.ctFtnEdn.addNewP(), this); paragraphs.add(p); bodyElements.add(p); // If the paragraph is the first paragraph in the footnote, // ensure that it has a footnote reference run. if (p.equals(getParagraphs().get(0))) { ensureFootnoteRef(p); } return p; }
/** * add a new paragraph to the end of the footnote * @param paragraph * @return the added XWPFParagraph */ public XWPFParagraph addNewParagraph(CTP paragraph) { CTP newPara = ctFtnEdn.addNewP(); newPara.set(paragraph); XWPFParagraph xPara = new XWPFParagraph(newPara, this); paragraphs.add(xPara); return xPara; }
/** * Add a new {@link XWPFParagraph} to the end of the footnote. * * @param paragraph CTP paragraph from which to construct the {@link XWPFParagraph} * @return The added {@link XWPFParagraph} */ public XWPFParagraph addNewParagraph(CTP paragraph) { CTP newPara = ctFtnEdn.addNewP(); newPara.set(paragraph); XWPFParagraph xPara = new XWPFParagraph(newPara, this); paragraphs.add(xPara); return xPara; }
/** * Appends a new {@link XWPFParagraph} to this footnote. * * @return The new {@link XWPFParagraph} * @since 4.0.0 */ public XWPFParagraph createParagraph() { XWPFParagraph p = new XWPFParagraph(this.ctFtnEdn.addNewP(), this); paragraphs.add(p); bodyElements.add(p); // If the paragraph is the first paragraph in the footnote, // ensure that it has a footnote reference run. if (p.equals(getParagraphs().get(0))) { ensureFootnoteRef(p); } return p; }
CTFtnEdn ctfInstance = CTFtnEdn.Factory.newInstance(); BigInteger id = new BigInteger("1"); ctfInstance.setId(id); CTP ctp = ctfInstance.addNewP(); ctp.addNewPPr().addNewPStyle().setVal("FootnoteText"); CTR ctr = ctp.addNewR(); ctr.addNewRPr().addNewRStyle().setVal("FootnoteReference"); ctr.addNewFootnoteRef(); CTText cttext = ctp.addNewR().addNewT(); cttext.setStringValue("This is the text in the footnote"); cttext.setSpace(SpaceAttribute.Space.PRESERVE);
CTP ctp = ctfInstance.addNewP();