Hi Team,
Hi team,
Hi Manish,
// Instantiate an object PDF class<o:p></o:p>
Document pdf = new Document();
// add the section to PDF document sections collection
Aspose.Pdf.Page sec1 = pdf.Pages.Add();
//Instantiate a table object
Aspose.Pdf.Table mytable = new Aspose.Pdf.Table();
mytable.Margin.Top = 300;
//Add the table in paragraphs collection of the desired section
sec1.Paragraphs.Add(mytable);
//Set with column widths of the table
mytable.ColumnWidths = "100 100 100 100 100 100 100";
// if you increase the counter to 17, table will break
//because it cannot be accommodated any more over this page
for (int RowCounter = 0; RowCounter <= 50; RowCounter++)
{
//Create rows in the table and then cells in the rows
Aspose.Pdf.Row row1 = mytable.Rows.Add();
row1.Cells.Add("col " + RowCounter.ToString() + ", 1");
row1.Cells.Add("col " + RowCounter.ToString() + ", 2");
row1.Cells.Add("col " + RowCounter.ToString() + ", 3");
row1.Cells.Add("col " + RowCounter.ToString() + ", 4");
row1.Cells.Add("col " + RowCounter.ToString() + ", 5");
row1.Cells.Add("col " + RowCounter.ToString() + ", 6");
row1.Cells.Add("col " + RowCounter.ToString() + ", 7");
}
mytable.IsBroken = true;
sec1.PageInfo.Width = 700 + sec1.PageInfo.Margin.Left + sec1.PageInfo.Margin.Right;
// save the resultant PDF document
pdf.Save(myDir+"DynamicTableWidth.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
The issues you have found earlier (filed as PDFNEWNET-38865) have been fixed in Aspose.Pdf for .NET 10.6.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.