public static void Run()
        {
            //ExStart:CloneAnotherPresentationAtSpecifiedPosition
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Slides_Presentations_CRUD();

            // ExStart:CloneAnotherPresentationAtSpecifiedPosition
            // Instantiate Presentation class to load the source presentation file
            using (Presentation sourcePresentation = new Presentation(dataDir + "AccessSlides.pptx"))
            {
                // Instantiate Presentation class for destination presentation (where slide is to be cloned)
                using (Presentation destPres = new Presentation())
                {
                    // Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation
                    ISlideCollection slideCollection = destPres.Slides;

                    // Clone the desired slide from the source presentation to the specified position in destination presentation
                    slideCollection.InsertClone(1, sourcePresentation.Slides[1]);

                    // ExEnd:CloneAnotherPresentationAtSpecifiedPosition
                    // Write the destination presentation to disk
                    destPres.Save(dataDir + "CloneAnotherPresentationAtSpecifiedPosition_out.pptx", SaveFormat.Pptx);
                }
            }
            //ExEnd:CloneAnotherPresentationAtSpecifiedPosition
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Slides_Presentations_CRUD();

            // Instantiate Presentation class that represents a presentation file
            using (Presentation pres = new Presentation(dataDir + "CloneWithInSamePresentation.pptx"))
            {
                // Clone the desired slide to the end of the collection of slides in the same presentation
                ISlideCollection slds = pres.Slides;

                // Clone the desired slide to the specified index in the same presentation
                slds.InsertClone(2, pres.Slides[1]);

                // Write the modified presentation to disk
                pres.Save(dataDir + "Aspose_CloneWithInSamePresentation_out.pptx", SaveFormat.Pptx);
            }
        }
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Slides_Presentations();

            //Instantiate Presentation class to load the source presentation file
            using (Presentation srcPres = new Presentation(dataDir + "CloneAtEndOfAnotherSpecificPosition.pptx"))
            {
                //Instantiate Presentation class for destination presentation (where slide is to be cloned)
                using (Presentation destPres = new Presentation())
                {
                    //Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation
                    ISlideCollection slds = destPres.Slides;

                    //Clone the desired slide from the source presentation to the specified position in destination presentation
                    slds.InsertClone(1, srcPres.Slides[1]);


                    //Write the destination presentation to disk
                    destPres.Save(dataDir + "Aspose_out.pptx", SaveFormat.Pptx);
                }
            }
        }