Beispiel #1
0
        /**
         * Creates an empty footnotes element for the document if one does not already exist
         * @return footnotes
         */
        public XWPFFootnotes CreateFootnotes()
        {
            if (footnotes == null)
            {
                FootnotesDocument footnotesDoc = new FootnotesDocument();

                XWPFRelation relation = XWPFRelation.FOOTNOTE;
                int i = GetRelationIndex(relation);

                XWPFFootnotes wrapper = (XWPFFootnotes)CreateRelationship(relation, XWPFFactory.GetInstance(), i);
                wrapper.SetFootnotes(footnotesDoc.Footnotes);
                footnotes = wrapper;
            }

            return footnotes;
        }
Beispiel #2
0
        private void InitFootnotes()
        {
            foreach(POIXMLDocumentPart p in GetRelations()){
               String relation = p.GetPackageRelationship().RelationshipType;
               if (relation.Equals(XWPFRelation.FOOTNOTE.Relation)) {
                  FootnotesDocument footnotesDocument = FootnotesDocument.Parse(p.GetPackagePart().GetInputStream());
                  this.footnotes = (XWPFFootnotes)p;
                  this.footnotes.OnDocumentRead();

                  foreach (CT_FtnEdn ctFtnEdn in footnotesDocument.Footnotes.footnote)
                  {
                     footnotes.AddFootnote(ctFtnEdn);
                  }
               } else if (relation.Equals(XWPFRelation.ENDNOTE.Relation)){
                   EndnotesDocument endnotesDocument = EndnotesDocument.Parse(p.GetPackagePart().GetInputStream());

                  foreach(CT_FtnEdn ctFtnEdn in endnotesDocument.Endnotes.endnote) {
                     endnotes.Add(int.Parse(ctFtnEdn.id), new XWPFFootnote(this, ctFtnEdn));
                  }
               }
            }
        }
Beispiel #3
0
 private void InitFootnotes()
 {
     foreach(POIXMLDocumentPart p in GetRelations()){
        String relation = p.GetPackageRelationship().RelationshipType;
        if (relation.Equals(XWPFRelation.FOOTNOTE.Relation)) {
           this.footnotes = (XWPFFootnotes)p;
           this.footnotes.OnDocumentRead();
        }
        else if (relation.Equals(XWPFRelation.ENDNOTE.Relation))
        {
            XmlDocument xmldoc = ConvertStreamToXml(p.GetPackagePart().GetInputStream());
            EndnotesDocument endnotesDocument = EndnotesDocument.Parse(xmldoc, NamespaceManager);
            foreach (CT_FtnEdn ctFtnEdn in endnotesDocument.Endnotes.endnote)
            {
                endnotes.Add(Int32.Parse(ctFtnEdn.id), new XWPFFootnote(this, ctFtnEdn));
            }
        }
     }
 }
Beispiel #4
0
 private void InitFootnotes()
 {
     foreach(POIXMLDocumentPart p in GetRelations()){
        String relation = p.GetPackageRelationship().RelationshipType;
        if (relation.Equals(XWPFRelation.FOOTNOTE.Relation)) {
            XmlDocument xmldoc = ConvertStreamToXml(p.GetPackagePart().GetInputStream());
           FootnotesDocument footnotesDocument = FootnotesDocument.Parse(xmldoc, NamespaceManager);
           this.footnotes = (XWPFFootnotes)p;
           this.footnotes.OnDocumentRead();
           
        } else if (relation.Equals(XWPFRelation.ENDNOTE.Relation)){
            XmlDocument xmldoc = ConvertStreamToXml(p.GetPackagePart().GetInputStream());
            EndnotesDocument endnotesDocument = EndnotesDocument.Parse(xmldoc, NamespaceManager);
        }
     }
 }