Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon May 28, 2012 1:29 am

Hi,

I am using Spire PDF to print a grid to pdf. I there a way to change the color of certain cells in a pdf instead of coloring entire rows ?

Zac.

zmathew
 
Posts: 2
Joined: Tue Dec 20, 2011 4:57 pm

Wed May 30, 2012 8:53 am

Hi Zac,

Thanks for your inquiry. I am glad to inform you that Spire.PDF enables users to change the color of the specific cells

with two lines of code:

//set color of certain cells
grid.Rows[0].Cells[1].Style.BackgroundBrush = PdfBrushes.Green;
grid.Rows[0].Cells[3].Style.BackgroundBrush = PdfBrushes.Red;

I also attach a live demo to provide more detail relate to this issue. Please have a check.

Though this works smoothly on my side, yet if there is any doubt or any new problem that troubles you, please feel

free to contact me at anytime, I will try my best to help you to solve it as soon as possible. Have a nice day.

Best Regards
Eric
e-iceblue support

guestbook
 
Posts: 2
Joined: Tue May 01, 2012 10:36 am

Return to Spire.PDF