right padding to Cell

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Re: right padding to Cell

DynamicPDF CoreSuite for .NET (v5) Forum

 Dec 10 2013 7:12 AM
Hi,
I am using dynamicpdf version 5.1.2.35. I am trying to render a cell with right padding (only to that particular cell). I could not find such property. Is there anything I can do?
 Dec 10 2013 10:54 AM
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.

All times are US Eastern Standard time. The time now is 12:58 AM.