Dear rmarala,
Thanks for considering Aspose.Slides
Please see the following example. I have also attached the output presentation generated by the code, please see it. The code is commented for your ease of understanding, if you still have question, please feel free to ask.
C#
//Create a presentation
Presentation pres = new Presentation();
//Get a slide
Slide sld = pres.GetSlideByPosition(1);
//Create 4 rectangles
Aspose.Slides.Rectangle rect1 = sld.Shapes.AddRectangle(760, 1050, 1730, 430);
Aspose.Slides.Rectangle rect2 = sld.Shapes.AddRectangle(760, 1830, 1730, 430);
Aspose.Slides.Rectangle rect3 = sld.Shapes.AddRectangle(3170, 1050, 1730, 430);
Aspose.Slides.Rectangle rect4 = sld.Shapes.AddRectangle(3170, 1830, 1730, 430);
//Give them background colors
rect1.FillFormat.Type = FillType.Solid;
rect1.FillFormat.ForeColor = Color.Aquamarine;
rect2.FillFormat.Type = FillType.Solid;
rect2.FillFormat.ForeColor = Color.Aquamarine;
rect3.FillFormat.Type = FillType.Solid;
rect3.FillFormat.ForeColor = Color.Bisque;
rect4.FillFormat.Type = FillType.Solid;
rect4.FillFormat.ForeColor = Color.Bisque;
//Assign center aligned bold text to first two rectangles
//1st
TextFrame tf = rect1.AddTextFrame(" ");
Paragraph para = tf.Paragraphs[0];
para.Alignment = TextAlignment.Center;
Portion port = tf.Paragraphs[0].Portions[0];
port.Text = "Column Name";
port.FontBold = true;
//2nd
tf = rect2.AddTextFrame(" ");
para = tf.Paragraphs[0];
para.Alignment = TextAlignment.Center;
port = tf.Paragraphs[0].Portions[0];
port.Text = "Column Name 2";
port.FontBold = true;
//Assign center aligned text to other two rectangles
//3rd
tf = rect3.AddTextFrame(" ");
para = tf.Paragraphs[0];
para.Alignment = TextAlignment.Center;
port = tf.Paragraphs[0].Portions[0];
port.Text = "Data";
//4th
tf = rect4.AddTextFrame(" ");
para = tf.Paragraphs[0];
para.Alignment = TextAlignment.Center;
port = tf.Paragraphs[0].Portions[0];
port.Text = "Data, Data";
pres.Write("c:\\outRectangles.ppt");
Many Thanks and Kind Regards,
Shakeel Faiz
Support Engineer
Aspose Tyumen Team