Posted by a ceTe Software moderator - Commonly asked question
Hi,
Yes. you can add TextArea, Label page elements below dynamic table without any problem using our DynamicPDF Core Suite for .NET product. You will need to calculate Y position and get the last page and table height and use these values to add elements after table laying is completed.
Here is a code sample.
float tabelht = 0;
float tableYPosition = 0;
Table2 table = new Table2(0, 0, 200, 692);
table.Columns.Add(100);
table.Columns.Add(100);
for(int i=1;i<100;i++)
{
Row2 row1= table.Rows.Add();
row1.Cells.Add("Columns1: Text" + i);
row1.Cells.Add("Columns2: Text" + i);
}
//Add table to document.
Document document = new Document();
do
{
Page page = new Page();
document.Pages.Add(page);
tableYPosition = table.Y;
page.Elements.Add(table);
tabelht = table.GetRequiredHeight();
table = table.GetOverflowRows();
} while (table != null);
int currentPageNumber = document.Pages.Count -1;
Page currentPage = document.Pages[currentPageNumber];
//Adding new TextArea below Table.
float YPosition = tableYPosition + tabelht + 10;
TextArea area = new TextArea("New Text below dynamic Table", 0, YPosition, 100, 40);
currentPage.Elements.Add(area);
string outputPdf = @"C:\Temp\MyTable.pdf";
document.Draw(outputPdf);
Thanks,
ceTe Software Support Team