I am inserting fragments of HTML to generate my document.
This generally works well however I have an issue that the table rows thus inserted are breaking across pages.
I assume there is no modification that I can make to my HTML in order to set this property declaratively (please let me know if I am wrong!) and it so happens in this document I am happy for all table rows to have this set to false so I have subscribed to the NodeInserted event as follows.
private void doc_NodeInserted(object sender, NodeChangedEventArgs e)
{
if (e.Node.NodeType == NodeType.Row)
{
((Aspose.Words.Tables.Row)e.Node).RowFormat.AllowBreakAcrossPages = false;
}
}
I am finding that the rows added through InsertHTML have this set to true in the final document though. I assume that some code runs after NodeInserted that overwrites my change.
I realise that in this instance I can loop through the rows after the doc is generated but thought it worth reporting.
Also just to repeat a point that I have made previously. IMO it would be a valuable addition to be able to access the associated HTML fragment in the NodeInserted event.
This would allow me to adapt to changing requirements much more flexibly as I could inspect the HTML attributes in the NodeInserted event and perform custom formatting depending on these.