Table Cell Borders printing incorrectly

I have set the borders on my table to black with a width of 1. For certain cells, i want to have no borders so i am using the following included at the bottom of the post. On the screen, this works perfectly. When I print, however, the table borders show up as black with a width of 1. How do I remove the cell border so that it does not print?

dim border as CellBorder=ctype(tableData.getCell(0,0),aspose.slides.Cell).BorderBottom

dim iter as IEnumerator = border.GetEnumerator()

While iter.MoveNext()

Dim line as Aspose.Slides.Line=Ctype(iter.Current, Aspose.Slides.Line)

line.LineFormat.ForeColor = Color.White

line.LineFormat.Width = 0

End While

Hello Dear,

Please use the code snippet given below to remove table cell borders so that you may avoid printing for that.

Aspose.Slides.Cell cell1 = table.GetCell(0, 3);
RemoveBorder(cell1.BorderBottom);
RemoveBorder(cell1.BorderLeft);
RemoveBorder(cell1.BorderRight);

private void RemoveBorder(CellBorder border)
{
IEnumerator iter = border.GetEnumerator();
// Loop through all the lines
while (iter.MoveNext())
{
Aspose.Slides.Line line = (Aspose.Slides.Line)iter.Current;
line.LineFormat.ForeColor = Color.White;
// Setting the width of the top border
line.LineFormat.Width = 0;
}
}

Thanks and Regards,

That is the exact code I am using. It shows the borders when you print on a printer. Is there another way to remove the borders so that they don’t print?

Hello Dear,

I am sorry for the inconvenience. I have modified the code snippet for your use and hopefully it will work for you this time.

Aspose.Slides.Cell cell1 = table.GetCell(0, 3);

RemoveBorder(cell1.BorderBottom);

RemoveBorder(cell1.BorderLeft);

RemoveBorder(cell1.BorderRight);

private void RemoveBorder(CellBorder border)

{

IEnumerator iter = border.GetEnumerator();

// Loop through all the lines

while (iter.MoveNext())

{

Aspose.Slides.Line line = (Aspose.Slides.Line)iter.Current;

line.LineFormat.ShowLines = false;

}

}

Thanks and Regards,