Posted by a ceTe Software moderator
Hello,
It is not possible to set the individual side padding (right, left, top and bottom) for the cell using version 5.x DynamicPDF Generator for .NET API.
We have added this feature to the later version of DynamicPDF Generator for .NET API. You can set the desired padding for individual sides (top, left, right and bottom) without any problem using our new Table2 page element which is available in version 7. Below is the sample code for it.
Document document = new Document();
Page page = new Page();
Table2 table = new Table2(10, 100, 300, 400);
table.Columns.Add(100);
table.Columns.Add(100);
Row2 row1 = table.Rows.Add();
string text = "This is to test Table example to set right padding to the cell";
Cell2 cell = row1.Cells.Add(text);
cell.Font = Font.Helvetica;
cell.Padding.Right = 20;
cell.Padding.Left = 15;
cell.Padding.Top = 10;
cell.Padding.Bottom = 5;
Cell2 cell2 = row1.Cells.Add(text);
cell2.Font = Font.Helvetica;
page.Elements.Add(table);
document.Pages.Add(page);
document.Draw(@"D:\Temp\TestTable2.pdf");
You can download the fully functional evaluation edition of version 7 DynamicPDF Generator for .NET product from our website
here. Please refer to the code samples included with the evaluation download.
Thanks,
ceTe Software Support Team.