/** * Create a new end note and add it to the document. * * @return New XWPFEndnote * @since 4.0.0 */ public XWPFEndnote createEndnote() { CTFtnEdn newNote = CTFtnEdn.Factory.newInstance(); newNote.setType(STFtnEdn.NORMAL); XWPFEndnote footnote = addEndnote(newNote); footnote.getCTFtnEdn().setId(getIdManager().nextId()); return footnote; }
/** * Create a new footnote and add it to the document. * * @return New {@link XWPFFootnote} * @since 4.0.0 */ public XWPFFootnote createFootnote() { CTFtnEdn newNote = CTFtnEdn.Factory.newInstance(); newNote.setType(STFtnEdn.NORMAL); XWPFFootnote footnote = addFootnote(newNote); footnote.getCTFtnEdn().setId(getIdManager().nextId()); return footnote; }
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);
/** * Create a new end note and add it to the document. * * @return New XWPFEndnote * @since 4.0.0 */ public XWPFEndnote createEndnote() { CTFtnEdn newNote = CTFtnEdn.Factory.newInstance(); newNote.setType(STFtnEdn.NORMAL); XWPFEndnote footnote = addEndnote(newNote); footnote.getCTFtnEdn().setId(getIdManager().nextId()); return footnote; }
/** * Create a new footnote and add it to the document. * * @return New {@link XWPFFootnote} * @since 4.0.0 */ public XWPFFootnote createFootnote() { CTFtnEdn newNote = CTFtnEdn.Factory.newInstance(); newNote.setType(STFtnEdn.NORMAL); XWPFFootnote footnote = addFootnote(newNote); footnote.getCTFtnEdn().setId(getIdManager().nextId()); return footnote; }
ctfInstance.setId(id); CTP ctp = ctfInstance.addNewP();