Free Support Forum - aspose.com

Coloring a cell

Is this the code you would use to color a cell? I took it almost exactly off another forum post, I believe it was the one on using custom fonts. The contents of the cell print, but I dont get any background color at all. Ive tried other colors than LightSeaGreen, but nothing works.
Thanks, Mark

row1.Cells.Add(row1Cell1);
row1Cell1.ColumnsSpan=4;
Text row1Cell1Text1 = new Text(section);
row1Cell1.Paragraphs.Add(row1Cell1Text1);
Segment row1Cell1Text1Seg1 = new Segment(row1Cell1Text1);
row1Cell1Text1Seg1.TextInfo.BackgroundColor = new Aspose.Pdf.Color();
row1Cell1Text1Seg1.TextInfo.BackgroundColor.ColorSpaceType=ColorSpaceType.Rgb;
row1Cell1Text1Seg1.TextInfo.BackgroundColor.RgbColorSpace = System.Drawing.Color.LightSeaGreen;

Dear MarkAurit,

Thanks for your consideration.

You shuold set the background color of the text or the cell, but not the segment. Please view the Aspose.Pdf.xsd file to know which properties you can use in a class.