Free Support Forum -

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

Text row1Cell1Text1 = new Text(section);
Segment row1Cell1Text1Seg1 = new Segment(row1Cell1Text1);
row1Cell1Text1Seg1.TextInfo.BackgroundColor = new Aspose.Pdf.Color();
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.