• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# OfficeOpenXML.PptxDocumentProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: TestReadInkAnnotations_6

        public void TestReadInkAnnotations_6()
        {
            string TEST_PPT = TESTFILE_DIR + "Test Multiple Slides Annotations.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(27, ttInks.GetChildCount());

                for (int i = 0; i != 27; i++)
                {
                    var value = ttInks.GetChild(i).GetInfo("Source")[0].value;
                    Assert.True(value.StartsWith(@"../ink/ink"));
                    Assert.True(value.EndsWith(@".xml"));
                }
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:24,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs


示例17: TestDiscoverHyperlinksInDiagrams

        public void TestDiscoverHyperlinksInDiagrams()
        {
            string TEST_PPT = TESTFILE_DIR + "Test Smart Art Hyperlinks.pptx";
            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                DocumentText dt = pdp.DocumentText;
                TextType ttHyperlink = pdp.DocumentText.GetTextTypes(ContentType.Hyperlink)[0] as TextType;
                Assert.AreEqual(3, ttHyperlink.GetChildCount(), "expected it to find three hyperlink items");


                TextType ttParagraphText = pdp.DocumentText.GetTextTypes(ContentType.Paragraph)[0] as TextType;
                Assert.AreEqual(15, ttParagraphText.GetChildCount(), "expected it to find 15 paragraph text items (including the comment)");
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:16,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs


示例18: TestDiscoverPptmDocumentWithFooter

        public void TestDiscoverPptmDocumentWithFooter()
        {
            string TEST_PPT = TESTFILE_DIR + "test021.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 ttFooter = pdp.DocumentText.GetTextTypes(ContentType.Footer)[0] as TextType;
                Assert.IsNotNull(ttFooter);
                Assert.Greater(ttFooter.GetChildCount(), 0);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:16,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs


示例19: TestDiscoverDiagrams

        public void TestDiscoverDiagrams()
        {
            string TEST_PPT = TESTFILE_DIR + "Test Ppt Smart Art.pptx";
            using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
            {
                pdp.Process(DocumentProcessingActions.Discover);

                DocumentText dt = pdp.DocumentText;
                TextType ttWhiteText = pdp.DocumentText.GetTextTypes(ContentType.WhiteText)[0] as TextType;
                Assert.AreEqual(3, ttWhiteText.GetChildCount(), "expected it to find three white text items");


                TextType ttParagraphText = pdp.DocumentText.GetTextTypes(ContentType.Paragraph)[0] as TextType;
                Assert.AreEqual(22, ttParagraphText.GetChildCount(), "expected it to find 22 paragraph text items");

            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:17,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs


示例20: TestDiscoverPotmTemplateWithComments

        public void TestDiscoverPotmTemplateWithComments()
        {
            string TEST_PPT = TESTFILE_DIR + "test023.potm.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(2, ttComments.GetChildCount());

                Assert.AreEqual("inserted comment from 2003", ttComments.GetChild(0).GetInfo("Content")[0].value);
                Assert.AreEqual("qaadmin", ttComments.GetChild(0).GetInfo("Author")[0].value);
                Assert.AreEqual("comment on a hidden sheet", ttComments.GetChild(1).GetInfo("Content")[0].value);
                Assert.AreEqual("qaadmin", ttComments.GetChild(1).GetInfo("Author")[0].value);
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:21,代码来源:TestPptxDocumentProcessor_Discover_StrictOpenXml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Network.WorldClass类代码示例发布时间:2022-05-26
下一篇:
C# Wombat.MamdaSubscription类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap