Hi
Thanks for your
inquiry. You should split tables and then insert PageBreak between sub tables. For
example see the following code:
//Open document and create
documentBuilder
Document doc = new Document(@"Test084\in.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//Get table from document
Table tab = doc.FirstSection.Body.Tables[0];
//Let's insert page break after 5th
row
//We should create new table
Table subTable = (Table)tab.Clone(false);
//Also we should create empty
paragraph
//And insert it directly after table
Paragraph par = new Paragraph(doc);
tab.ParentNode.InsertAfter(par, tab);
//Now we should insert new table
after thsi paragraph
par.ParentNode.InsertAfter(subTable, par);
//Cut all rows after 5th row and
insert them into the sub table
while (tab.IndexOf(tab.LastRow) != 4)
{
subTable.Rows.Insert(0, tab.LastRow);
}
//And now we can insert Page Break
//we should move DocumentBuilder
cursor to the paragraph
//between sub tables
builder.MoveTo(par);
builder.InsertBreak(BreakType.PageBreak);
//Save document
doc.Save(@"Test084\out.doc");
Hope this
helps.
Best
regards.
Alexey Noskov
Developer/Technical Support
Aspose Auckland Team