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

Free Support Forum - aspose.com

Portion property FontBold not changed

Hello,

when I try to change Portion’s class property FontBold to true, value remains false and final presentation in PowerPoint is also without bold texts.

PortionEx works fine for that property!

Thanks,
marxin

Hi Marxin,


Please use the code snippet given below to use the font related properties on Portion class.

Presentation pres = new Presentation();
Slide slide = pres.Slides[0];

Aspose.Slides.Rectangle shapeTxtRTF = slide.Shapes.AddRectangle(0, 0, 500, 300);
LineFormat llRTF = shapeTxtRTF.LineFormat;
llRTF.ShowLines = false;
TextFrame tfRTF = shapeTxtRTF.AddTextFrame(string.Empty);


Aspose.Slides.Paragraph para = new Aspose.Slides.Paragraph();
para.Text = string.Empty;
tfRTF.Paragraphs.RemoveAt(0);
tfRTF.Paragraphs.Add(para);
int c = para.Portions.Count;
para.Portions[0].FontBold = true; ;
para.Portions[0].FontItalic = true;
para.Portions[0].FontHeight = (short)16;
para.Portions[0].FontColor = Color.DarkCyan;
para.Portions[0].FontUnderline = true;
para.Portions[0].Text = “Hello World”;

tfRTF.WrapText = true;
tfRTF.FitShapeToText = true;

pres.Write(“D:\Aspose Data\PortionText.ppt”);

Many Thanks,