当前位置: 首页>>代码示例>>C#>>正文


C# OfficeOpenXML.PptxDocumentProcessor类代码示例

本文整理汇总了C#中Workshare.Fcs.Lite.OfficeOpenXML.PptxDocumentProcessor的典型用法代码示例。如果您正苦于以下问题:C# PptxDocumentProcessor类的具体用法?C# PptxDocumentProcessor怎么用?C# PptxDocumentProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PptxDocumentProcessor类属于Workshare.Fcs.Lite.OfficeOpenXML命名空间,在下文中一共展示了PptxDocumentProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestPassthroughPptxDocumentWithHiddenSlides

        public void TestPassthroughPptxDocumentWithHiddenSlides()
        {
            string TEST_PPT = TESTFILE_DIR + "test002.pptx";
            try
            {
                using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
                {
                    using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
                    {
                        pdp.Process(DocumentProcessingActions.PassThrough);
                    }
                }
                Assert.IsTrue(CommonTestUtilities.AreZipFilesEqual(TEST_PPT, TEST_OUTPUT_FILE));

                using (PptxDocumentProcessor pdpII = new PptxDocumentProcessor(File.Open(TEST_OUTPUT_FILE, FileMode.Open)))
                {
                    pdpII.Process(DocumentProcessingActions.Discover);

                    Assert.IsNotNull(pdpII.DocumentText, "expected the document text object to be valid");
                    Assert.Greater(pdpII.DocumentText.GetTextTypes().Count, 0, "expected some document text types to have been added");

                    TextType ttHiddenSlide = pdpII.DocumentText.GetTextTypes(ContentType.HiddenSlide)[0] as TextType;
                    Assert.IsNotNull(ttHiddenSlide);
                    Assert.AreEqual(2, ttHiddenSlide.GetChildCount());
                    Assert.AreEqual("2", ttHiddenSlide.GetChild(0).GetInfo("SlideNumber")[0].value);
                    Assert.AreEqual("3", ttHiddenSlide.GetChild(1).GetInfo("SlideNumber")[0].value);
                }
            }
            finally
            {
                File.Delete(TEST_OUTPUT_FILE);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:TestPptxDocumentProcessor_Passthrough_Office2013.cs

示例2: TestPassthroughPptxDocumentEmptyPresentation

 public void TestPassthroughPptxDocumentEmptyPresentation()
 {
     string TEST_PPT = TESTFILE_DIR + "test001.pptx";
     try
     {
         using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
         {
             using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
             {
                 pdp.Process(DocumentProcessingActions.PassThrough);
             }
         }
         Assert.IsTrue(CommonTestUtilities.AreZipFilesEqual(TEST_PPT, TEST_OUTPUT_FILE));
         
         using (OPCPackage package = new OPCPackage(File.Open(TEST_OUTPUT_FILE, FileMode.Open)))
         {
             foreach (ContentTypeInfo cti in package.GetContentTypes())
             {
                 if (cti.Name == "/docProps/thumbnail.jpeg")
                     Assert.Fail("Ooops, put in overrides of content types for parts that didn't have override info");
             }
         }
     }
     finally
     {
         File.Delete(TEST_OUTPUT_FILE);
     }
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:28,代码来源:TestPptxDocumentProcessor_Passthrough_Office2013.cs

示例3: TestDiscoverPptmComments

        public void TestDiscoverPptmComments()
        {
            string TEST_PPT = TESTFILE_DIR + "test003.pptm.pptx";
            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                Assert.IsNotNull(pdp.DocumentText, "expected the document text object to be valid");
                Assert.Greater(pdp.DocumentText.GetTextTypes().Count, 0, "expected some document text types to have been added");

                DocumentText dt = pdp.DocumentText;
                TextType ttComments = pdp.DocumentText.GetTextTypes(ContentType.Comment)[0] as TextType;
                Assert.IsNotNull(ttComments);
                Assert.AreEqual(3, ttComments.GetChildCount());

                Assert.AreEqual("hjrehjkwr\n", ttComments.GetChild(0).GetInfo("Content")[0].value);
                Assert.AreEqual("Mena Shervill", ttComments.GetChild(0).GetInfo("Author")[0].value);

                Assert.AreEqual("Another comment", ttComments.GetChild(1).GetInfo("Content")[0].value);
                Assert.AreEqual("bobh", ttComments.GetChild(1).GetInfo("Author")[0].value);

                Assert.AreEqual("For use as no doubt", ttComments.GetChild(2).GetInfo("Content")[0].value);
                Assert.AreEqual("bobh", ttComments.GetChild(2).GetInfo("Author")[0].value);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:25,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs

示例4: TestCleanPptxDocumentWithFields_ActuallyOLEObjects

        public void TestCleanPptxDocumentWithFields_ActuallyOLEObjects()
        {
            string TEST_PPT = TESTFILE_DIR + "test007.pptx";
            try
            {
                Assert.IsTrue(PptxTestUtilities.DocumentContainsEmbeddedObjects(TEST_PPT), "Embedded object left in document");

                using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
                {
                    using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
                    {
                        pdp.Process(DocumentProcessingActions.Clean);
                    }
                }

                using (PptxDocumentProcessor pdpII = new PptxDocumentProcessor(File.Open(TEST_OUTPUT_FILE, FileMode.Open)))
                {
                    pdpII.Process(DocumentProcessingActions.Discover);

                    DocumentText dt = pdpII.DocumentText;
                    Assert.IsNotNull(dt, "expected the document text object to be valid");
                    List<IAbstractTextType> listFields = pdpII.DocumentText.GetTextTypes(ContentType.Field);
                    Assert.IsNotNull(listFields, "Clean documents should have empty lists");
                    Assert.AreEqual(0, listFields.Count, "Clean documents should have empty lists");
                }

                Assert.IsFalse(PptxTestUtilities.DocumentContainsEmbeddedObjects(TEST_OUTPUT_FILE), "Embedded object left in document");
            }
            finally
            {
                File.Delete(TEST_OUTPUT_FILE);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:TestPptxDocumentProcessor_Clean.cs

示例5: PptxPresentationPartFilter

 public PptxPresentationPartFilter(CommonNamespaces commonNamespaces, PptxDocumentProcessor docproc, bool interestedInHiddenSlides)
     : base(commonNamespaces)
 {
     m_parentDocProc = docproc;
     Triggers.AddRange(PptxMetadataDefinitions.Hyperlink);
     m_interestedInHiddenSlides = interestedInHiddenSlides;
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:PptxPresentationPartFilter.cs

示例6: Read

 public override DocumentText Read()
 {
     using (PptxDocumentProcessor dp = new PptxDocumentProcessor(m_data.AsStream()))
     {
         dp.Process(DocumentProcessingActions.Discover);
         return dp.DocumentText;
     }
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:8,代码来源:PptxDocumentReader.cs

示例7: CleanTo

 public void CleanTo(Stream strDest, List<ContentType> elementsToClean)
 {
     using (PptxDocumentProcessor dp = new PptxDocumentProcessor(m_data.AsStream(), elementsToClean))
     {
         dp.Output = strDest;
         dp.Process(DocumentProcessingActions.Clean);
         strDest.Close();
     }
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:9,代码来源:PptxDocumentReader.cs

示例8: TestSorting_SlideOrder

        public void TestSorting_SlideOrder()
        {
            string TEST_PPT = TESTFILE_DIR + "test002.pptx";
            try
            {
                using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
                {
                    using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
                    {
                        pdp.Process(DocumentProcessingActions.PassThrough);
                    }
                    PptxPresentationPartFilter ppf = pdp.GetPresentationPartFilter() as PptxPresentationPartFilter;
                    Assert.IsNotNull(ppf);
                    List<PartInfo> srpl = ppf.SortedRelatedParts;
                    Assert.AreEqual(9, srpl.Count, "Different number of related parts");

                    PartInfo pi = srpl[0];
                    Assert.AreEqual("rId2", pi.Id);
                    Assert.AreEqual("slides/slide1.xml", pi.Target);
                    pi = srpl[1];
                    Assert.AreEqual("rId3", pi.Id);
                    Assert.AreEqual("slides/slide2.xml", pi.Target);
                    pi = srpl[2];
                    Assert.AreEqual("rId4", pi.Id);
                    Assert.AreEqual("slides/slide3.xml", pi.Target);
                    pi = srpl[3];
                    Assert.AreEqual("rId8", pi.Id);
                    Assert.AreEqual("theme/theme1.xml", pi.Target);
                    pi = srpl[4];
                    Assert.AreEqual("rId7", pi.Id);
                    Assert.AreEqual("viewProps.xml", pi.Target);
                    pi = srpl[5];
                    Assert.AreEqual("rId1", pi.Id);
                    Assert.AreEqual("slideMasters/slideMaster1.xml", pi.Target);
                    pi = srpl[6];
                    Assert.AreEqual("rId6", pi.Id);
                    Assert.AreEqual("presProps.xml", pi.Target);
                    pi = srpl[7];
                    Assert.AreEqual("rId5", pi.Id);
                    Assert.AreEqual("notesMasters/notesMaster1.xml", pi.Target);
                    pi = srpl[8];
                    Assert.AreEqual("rId9", pi.Id);
                    Assert.AreEqual("tableStyles.xml", pi.Target);
                }
            }
            finally
            {
                File.Delete(TEST_OUTPUT_FILE);
            }
       }
开发者ID:killbug2004,项目名称:WSProf,代码行数:50,代码来源:TestPptxPresentationPartFilter.cs

示例9: TestDiscoverPptxHiddenSlides

        public void TestDiscoverPptxHiddenSlides()
        {
            string TEST_PPT = TESTFILE_DIR + "test002.pptx";
            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                Assert.IsNotNull(pdp.DocumentText, "expected the document text object to be valid");
                Assert.Greater(pdp.DocumentText.GetTextTypes().Count, 0, "expected some document text types to have been added");

                DocumentText dt = pdp.DocumentText;
                TextType ttHiddenSlide = pdp.DocumentText.GetTextTypes(ContentType.HiddenSlide)[0] as TextType;
                Assert.IsNotNull(ttHiddenSlide);
                Assert.AreEqual(2, ttHiddenSlide.GetChildCount());
                Assert.AreEqual("2", ttHiddenSlide.GetChild(0).GetInfo("SlideNumber")[0].value);
                Assert.AreEqual("3", ttHiddenSlide.GetChild(1).GetInfo("SlideNumber")[0].value);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:18,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs

示例10: TestHiddenSlideLookupByTargetName

 public void TestHiddenSlideLookupByTargetName()
 {
     string TEST_PPT = TESTFILE_DIR + "test002.pptx";
     try
     {
         using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
         {
             using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
             {
                 pdp.Process(DocumentProcessingActions.PassThrough);
             }
             Assert.IsFalse(pdp.IsSlideHidden("burble"), "Invalid target so can't be hidden");
             Assert.IsFalse(pdp.IsSlideHidden("slides/slide1.xml"), "Only slide 1 should be visible");
             Assert.IsTrue(pdp.IsSlideHidden("slides/slide2.xml"), "Only slide 1 should be visible");
             Assert.IsTrue(pdp.IsSlideHidden("slides/slide3.xml"), "Only slide 1 should be visible");
         }
     }
     finally
     {
         File.Delete(TEST_OUTPUT_FILE);
     }
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:22,代码来源:TestPptxSlidePartFilter.cs

示例11: TestHiddenSlideLookup

 public void TestHiddenSlideLookup()
 {
     string TEST_PPT = TESTFILE_DIR + "test002.pptx";
     try
     {
         using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
         {
             using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
             {
                 pdp.Process(DocumentProcessingActions.PassThrough);
             }
             Assert.IsFalse(pdp.IsSlideHidden(0), "Uses number not index so can't be hidden");
             Assert.IsFalse(pdp.IsSlideHidden(1), "Only slide 1 should be visible");
             Assert.IsTrue(pdp.IsSlideHidden(2), "Only slide 1 should be visible");
             Assert.IsTrue(pdp.IsSlideHidden(3), "Only slide 1 should be visible");
             Assert.IsFalse(pdp.IsSlideHidden(4), "Value out of range so can't be hidden");
         }
     }
     finally
     {
         File.Delete(TEST_OUTPUT_FILE);
     }
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:23,代码来源:TestPptxSlidePartFilter.cs

示例12: TestDiscoverPptxDocumentContentEverywhere

        public void TestDiscoverPptxDocumentContentEverywhere()
        {
            string TEST_PPT = TESTFILE_DIR + "test027.pptx";
            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                Assert.IsNotNull(pdp.DocumentText, "expected the document text object to be valid");
                Assert.Greater(pdp.DocumentText.GetTextTypes().Count, 0, "expected some document text types to have been added");

                TextType ttParaText = pdp.DocumentText.GetTextTypes(ContentType.Paragraph)[0] as TextType;
                Assert.IsNotNull(ttParaText);

                CheckContentNode(ttParaText, "Table on slide");
                CheckContentNode(ttParaText, "Note on slide");
                CheckContentNode(ttParaText, "Footer on slide master");
                CheckContentNode(ttParaText, "Table on slide master");
                CheckContentNode(ttParaText, "Table on notes master");
                CheckContentNode(ttParaText, "Footer on notes master");
                CheckContentNode(ttParaText, "Table on handout master");
                CheckContentNode(ttParaText, "Footer on handout master");
                CheckContentNode(ttParaText, "Comment Text");
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:24,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs

示例13: TestDiscoverPptxHyperlinks

        public void TestDiscoverPptxHyperlinks()
        {
            string TEST_PPT = TESTFILE_DIR + "test004.pptx";
            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                Assert.IsNotNull(pdp.DocumentText, "expected the document text object to be valid");
                Assert.Greater(pdp.DocumentText.GetTextTypes().Count, 0, "expected some document text types to have been added");

                TextType ttHyperlinks = pdp.DocumentText.GetTextTypes(ContentType.Hyperlink)[0] as TextType;
                Assert.IsNotNull(ttHyperlinks);
                Assert.AreEqual(1, ttHyperlinks.GetChildCount());
                Assert.AreEqual("Hyperlink", ttHyperlinks.GetChild(0).GetInfo("Target")[0].value);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:16,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs

示例14: TestGetSlideRelIdFromPosition

        public void TestGetSlideRelIdFromPosition()
        {
            string TEST_PPT = TESTFILE_DIR + "test002.pptx";
            try
            {
                using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
                {
                    using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
                    {
                        pdp.Process(DocumentProcessingActions.PassThrough);
                    }
                    PptxPresentationPartFilter ppf = pdp.GetPresentationPartFilter() as PptxPresentationPartFilter;
                    Assert.IsNotNull(ppf);

                    Assert.AreEqual(string.Empty, ppf.GetSlideRelIdFromPosition(0));
                    Assert.AreEqual("rId2", ppf.GetSlideRelIdFromPosition(1));
                    Assert.AreEqual("rId3", ppf.GetSlideRelIdFromPosition(2));
                    Assert.AreEqual("rId4", ppf.GetSlideRelIdFromPosition(3));
                    Assert.AreEqual(string.Empty, ppf.GetSlideRelIdFromPosition(4));
                }
            }
            finally
            {
                File.Delete(TEST_OUTPUT_FILE);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:26,代码来源:TestPptxPresentationPartFilter.cs

示例15: TestReadInkAnnotations_5

        public void TestReadInkAnnotations_5()
        {
            string TEST_PPT = TESTFILE_DIR + "Test Simple with annotation.pptx";

            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                Assert.IsNotNull(pdp.DocumentText, "expected the document text object to be valid");
                Assert.Greater(pdp.DocumentText.GetTextTypes().Count, 0, "expected some document text types to have been added");

                DocumentText dt = pdp.DocumentText;
                TextType ttInks = pdp.DocumentText.GetTextTypes(ContentType.InkAnnotation)[0] as TextType;
                Assert.IsNotNull(ttInks);
                Assert.AreEqual(1, ttInks.GetChildCount());

                Assert.AreEqual(@"../ink/ink1.xml", ttInks.GetChild(0).GetInfo("Source")[0].value);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:19,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs


注:本文中的Workshare.Fcs.Lite.OfficeOpenXML.PptxDocumentProcessor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。