Пример #1
0
        /**
         * add a footnote to the document
         * @param note
         * @throws IOException
         */
        public XWPFFootnote AddFootnote(CT_FtnEdn note)
        {
            CT_FtnEdn newNote = ctFootnotes.AddNewFootnote();

            newNote.Set(note);
            XWPFFootnote xNote = new XWPFFootnote(newNote, this);

            listFootnote.Add(xNote);
            return(xNote);
        }
Пример #2
0
        public void TestAddFootnotesToDocument()
        {
            XWPFDocument docOut = new XWPFDocument();

            int noteId = 1;

            XWPFFootnotes footnotes = docOut.CreateFootnotes();
            CT_FtnEdn     ctNote    = new CT_FtnEdn();

            ctNote.id   = (noteId.ToString());
            ctNote.type = (ST_FtnEdn.normal);
            footnotes.AddFootnote(ctNote);

            XWPFDocument docIn = XWPFTestDataSamples.WriteOutAndReadBack(docOut);

            XWPFFootnote note = docIn.GetFootnoteByID(noteId);

            Assert.AreEqual(note.GetCTFtnEdn().type, ST_FtnEdn.normal);
        }
Пример #3
0
 /**
  * add an XWPFFootnote to the document
  * @param footnote
  * @throws IOException
  */
 public void AddFootnote(XWPFFootnote footnote)
 {
     listFootnote.Add(footnote);
     ctFootnotes.AddNewFootnote().Set(footnote.GetCTFtnEdn());
 }