We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Columns are sliced vertically in table in pdf-can we move it to new table

Hi Team,

I have a table with some data which does’nt fit in the current page. It cuts the few columns.
It is possible to split the table in vertically and move it to the new page.


// Instantiate an object PDF class
Aspose.Pdf.Generator.Pdf pdf = new Pdf();
// add the section to PDF document sections collection
Aspose.Pdf.Generator.Section sec1 = pdf.Sections.Add();
//Instantiate a table object
Aspose.Pdf.Generator.Table mytable = new Aspose.Pdf.Generator.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.Generator.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”);
}
// get the Page Height information
float PageHeight = pdf.PageSetup.PageHeight;
// get the total height information of Page Top & Bottom margin,
// table Top margin and table height.
//float TotalObjectsHeight = section.PageInfo.Margin.Top + section.PageInfo.Margin.Bottom + table1.Margin.Top + table1.GetHeight(pdf);

// pdf.Save(@“D:/pdftest/TableIsBrokenTest.pdf”);
mytable.IsBroken = true;
// add table to paragraphs collection of section
// sec1.Paragraphs.Add(mytable);
// save the resultant PDF document
pdf.Save(@“D:\test\DynamicTableWidth.pdf”);

Hi Manish,


Thanks for your inquiry. As we stated in your another similar query, I am afraid currently the feature is not supported. So we have logged an enhancement ticket PDFNEWNET-38865 for the purpose. We will notify you as soon as it is resolved.

As workaround you may increase the Page width, code suggested in above referred post.

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.
(9)