Aspose.Slides.Examples.CSharp.Text.RotatingText.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_Text();

            // ExStart:RotatingText
            // Create an instance of Presentation class
            Presentation presentation = new Presentation();

            // Get the first slide 
            ISlide slide = presentation.Slides[0];

            // Add an AutoShape of Rectangle type
            IAutoShape ashp = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 150, 75, 350, 350);

            // Add TextFrame to the Rectangle
            ashp.AddTextFrame(" ");
            ashp.FillFormat.FillType = FillType.NoFill;

            // Accessing the text frame
            ITextFrame txtFrame = ashp.TextFrame;
            txtFrame.TextFrameFormat.TextVerticalType = TextVerticalType.Vertical270;

            // Create the Paragraph object for text frame
            IParagraph para = txtFrame.Paragraphs[0];

            // Create Portion object for paragraph
            IPortion portion = para.Portions[0];
            portion.Text = "A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.";
            portion.PortionFormat.FillFormat.FillType = FillType.Solid;
            portion.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;

            // ExEnd:RotatingText
            // Save Presentation
            presentation.Save(dataDir + "RotateText_out.pptx", SaveFormat.Pptx); 
        }
    }
RotatingText