Aspose.Slides.Examples.CSharp.Presentations.Saving.SaveToStream.Run C# (CSharp) Метод

Run() публичный статический Метод

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_PresentationSaving();

            // Instantiate a Presentation object that represents a PPT file
            using (Presentation presentation = new Presentation())
            {

                IAutoShape shape = presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 200, 200, 200, 200);

                // Add text to shape
                shape.TextFrame.Text = "This demo shows how to Create PowerPoint file and save it to Stream.";

                FileStream toStream = new FileStream(dataDir + "Save_As_Stream_out.pptx", FileMode.Create);
                presentation.Save(toStream, Aspose.Slides.Export.SaveFormat.Pptx);
                toStream.Close();
            }
        }
    }
SaveToStream