Aspose.Slides.Examples.CSharp.Slides.CRUD.CloneWithInSamePresentation.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        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);

            }
            
        }
    }
CloneWithInSamePresentation