Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies within .NET ( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Mon May 28, 2012 1:29 am


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 ?


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
e-iceblue support
You do not have the required permissions to view the files attached to this post.

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

Return to Spire.PDF