Hey -
Hi Brian,
Thanks for your inquiry. I have tested the scenario using new DOM approach to set bottom border and it is working without any issue. Please use new generator for the purpose, it will resolve the issue.
- [Set border style, Margins and padding of Table(New genertor)]
(http://www.aspose.com/docs/display/pdfnet/Set+Border+Style%2C+Margins+and+Padding+of+the+Table+%28MergedAPI%29)
Please feel free to contact us for any further assistance.
Best Regards,
So you guys no longer support the PDF.Generator namespace? I ask because switching to the other namespace would mean I rewrite thousands of lines of code … and put it all through QA again/etc.
Just a quick further note. If I put a border around EVERY cell, it works fine. This problem happens if I have borders (top or bottom) on just the first and last row(s).
bsaunders66:So you guys no longer support the PDF.Generator namespace? I ask because switching to the other namespace would mean I rewrite thousands of lines of code ... and put it all through QA again/etc.It's a very big ask for such a tiny problem. Feels a little bit like maybe you just want to make sure you are actually asking me to do that before you suggest I throw out the code I've written with you for the last 5 years?So - pdf.generator is now deprecated??
//Instntiate the Pdf object by calling its empty constructor
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document();
//Create the section in the Pdf object
Aspose.Pdf.Page sec = pdf.Pages.Add();
//Instantiate a table object
Aspose.Pdf.Table tab = new Aspose.Pdf.Table();
//Add the table in paragraphs collection of the desired section
sec.Paragraphs.Add(tab);
//Set with column widths of the table
tab.ColumnWidths = "100 100 100";
//Create header row
Aspose.Pdf.Row rowhead = tab.Rows.Add();
rowhead.Cells.Add("col1");
rowhead.Cells.Add("col2");
rowhead.Cells.Add("col3");
rowhead.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Bottom, 0.1F);
for (int i = 1; i < 6; i++)
{
Aspose.Pdf.Row row = tab.Rows.Add();
row.Cells.Add("Row" + i + "col1");
row.Cells.Add("Row" + i + "col2");
row.Cells.Add("Row" + i + "col3");
}
//Create footer row
Aspose.Pdf.Row rowfoot = tab.Rows.Add();
rowfoot.Cells.Add("col1");
rowfoot.Cells.Add("col2");
rowfoot.Cells.Add("col3");
rowfoot.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Top, 0.1F);
//Save the Pdf
pdf.Save(myDir + "TableResultDOM.pdf");
bsaunders66:Just a quick further note. If I put a border around EVERY cell, it works fine. This problem happens if I have borders (top or bottom) on just the first and last row(s).Typical data table scenario:Heading----------DataDataData----------TotalHi Brian,Adding more to Tilal's comments, when using the code snippet based on new Document Object Model (DOM), I am unable to notice any issue and border properly renders for cells inside PDF document. Should you have any further query, please feel free to contact.