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

Free Support Forum - aspose.com

Insert PageBreak between Tables

hi there…


This code is made by copying table of aspose.word.
I need to insert a pagebreak between the tables, please tell me how to do it.

g_docWord = new Document(Server.MapPath("~/template/") + “abc.doc”);
g_dbBuilder = new DocumentBuilder(g_docWord);

Table table = (Aspose.Words.Tables.Table)g_docWord.GetChild(NodeType.Table, 0, true);
Aspose.Words.Tables.Table tableClone = (Table)table.Clone(true);
table.ParentNode.InsertAfter(tableClone, table);
table.ParentNode.InsertAfter(new Paragraph(g_docWord), table);

Hi,


Thanks for your inquiry. You can insert an empty paragraph between these two tables and just add a Run containing a PageBreak character to this paragraph:

para.Runs.Add(new Run(doc, ControlChar.PageBreak));

I hope, this helps.

Best regards,