Exemple #1
0
        /*
         * [Test]
         * public void TestPowerPoint()
         * {
         *  POIXMLDocument doc = new XSLFSlideShow(OPCPackage.Open(
         *          POIDataSamples.GetSlideShowInstance().OpenResourceAsStream("PPTWithAttachments.pptm"))
         *  );
         *  Test(doc, 4);
         * }*/

        private void Test(POIXMLDocument doc, int expectedCount)
        {
            Assert.IsNotNull(doc.GetAllEmbedds());
            Assert.AreEqual(expectedCount, doc.GetAllEmbedds().Count);

            for (int i = 0; i < doc.GetAllEmbedds().Count; i++)
            {
                PackagePart pp = doc.GetAllEmbedds()[i];
                Assert.IsNotNull(pp);

                byte[] b = IOUtils.ToByteArray(pp.GetStream(System.IO.FileMode.Open));
                Assert.IsTrue(b.Length > 0);
            }
        }
        /**
         * Creates a new POIXMLPropertiesTextExtractor for the
         *  given open document.
         */

        public POIXMLPropertiesTextExtractor(POIXMLDocument doc)
            : base(doc)
        {
        }
Exemple #3
0
        /**
         * Creates a new text extractor for the given document
         */

        public POIXMLTextExtractor(POIXMLDocument document)
            : base((POIDocument)null)
        {
            _document = document;
        }