We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to outdent text with Aspose.Slides?

For outdenting text, you need to work with Paragraph.BulletOffset and Paragraph.TextOffset properties.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Below is the code, how to do it. Also see the output presentation which is attached with this post.

C#

-------------------------------------------------------------------------------

Presentation pres = new Presentation();

Slide sld = pres.GetSlideByPosition(1);

Aspose.Slides.Rectangle rect = sld.Shapes.AddRectangle(100, 100, 3000, 2000);

rect.LineFormat.ShowLines = false;

TextFrame tf = rect.AddTextFrame("");

tf.WrapText = true;

//Normal paragraph

Paragraph para = tf.Paragraphs[0];

para.Text = "This is some text.";

//Create outdented paragraph

Paragraph newPara = new Paragraph(para);

newPara.Text = "This is some more text. This is some more text.";

newPara.Text +=" This is some more text. This is some more text.";

newPara.BulletOffset = 200;

newPara.TextOffset = 200;

tf.Paragraphs.Add(newPara);

//Create another outdented paragraph

newPara = new Paragraph(para);

newPara.Text = "Another out dented text. Another out dented text.";

newPara.BulletOffset = 400;

newPara.TextOffset = 400;

tf.Paragraphs.Add(newPara);

//Create another outdented and bulleted paragraph

newPara = new Paragraph(para);

newPara.Text = "Another out dented and bulleted text. Another out dented and bulleted text.";

newPara.HasBullet = true;

newPara.BulletOffset = 400;

newPara.TextOffset = 600;

tf.Paragraphs.Add(newPara);

tf.FitShapeToText = true;

pres.Write("c:\\OutdentingText.ppt");

-------------------------------------------------------------------------------