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).
Hi there,
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??
We are sorry for the inconvenience. Aspose.Pdf.Generator is not deprecated at the moment, however it will be deprecated in near future. We are fixing old generator issues in new generator and adding new features/enhancement in new generator only. As it is more efficient and improved, it can create a PDF from scratch and manipulate existing PDF documents as well.
So it is recommended to migrate to new generator. Almost all object names and functionalities are same except Pdf and Section object these are replaced with Document and Page object respectively. Please find sample code for reference.
// Instantiate 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");
Please feel free to contact us for any further assistance.
Best Regards,
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.