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

Free Support Forum - aspose.com

The cell background color overlaps the cell above

Hi! I have a cell background color issue with Aspose 8.0. In the attached PDF you can see that the bottom cell background color overlaps the cell above. It is not a lot (maybe 1 pixel) but it can still be seen in the viewer and on paper. Here is the code used to produce the attached PDF:


public static void CellBackgroundColorOverlapsOtherCell()
{
Pdf pdf = new Pdf();
Section section = new Section(pdf);
pdf.Sections.Add(section);

Table table = new Table() { ColumnWidths = “150 15” };

Row row = table.Rows.Add();
row.FixedRowHeight = 45.0f;
AddCellWithBackground(row, “LightGray”);
row.Cells.Add();

// Second row is green on all cells. It’s going to look like a separation line and in the output
// we can see the width. The gray from the bottom cell seems to overlap with the green.
// Even if we set the FixedRowHeight to a greater value (ex.: 4), we still see the glitch.
row = table.Rows.Add();
row.FixedRowHeight = 0.5f;
//row.BackgroundColor = new Color(“Green”); // We can still see the glitch with this line
AddCellWithBackground(row, “Green”);
AddCellWithBackground(row, “Green”);

row = table.Rows.Add();
row.FixedRowHeight = 45.0f;
AddCellWithBackground(row, “LightGray”);
row.Cells.Add();

section.Paragraphs.Add(table);

string filename = @“d:\CellBackgroundColorOverlapsOtherCell.pdf”;
pdf.Save(filename);
Process.Start(filename);
}

private static void AddCellWithBackground(Row row, string backgroundColor)
{
Cell c = row.Cells.Add();
c.BackgroundColor = new Color(backgroundColor);
}

Thanks,

Jean-François Rouleau

Hi there,


Thanks for your inquiry. I've managed to reproduce the issue at my end and logged it as PDFNEWNET-35294 in our bug tracking system for further investigation and resolution. You will be notified via this thread as soon as it is resolved.


Sorry for the inconvenience faced.


Best Regards,

Hi Jean-François,


Thanks for your patience.

I am pleased to share that the issue reported earlier has been resolved in recent release of Aspose.Pdf for .NET 8.1.0. In case you still face the same issue or you have any further query, please feel free to contact.