Having trouble combining documents



I am combining documents with the following function:

public void CombineDocuments(Document dstDoc, Document srcDoc){
foreach (Section srcSection in srcDoc) {
Node dstSection = dstDoc.ImportNode(srcSection, true, ImportFormatMode.KeepSourceFormatting);

I think I found that sample code somewhere in the forum.

The problem I have is that when I combine certain documents(Doc1 and Doc2), the first page of Doc2 starts on the last page of Doc1 instead of on the "next" page.

Can I remove this issue with something on the source Word file side? On the Aspose component side?

Any help would be appreciated.


Try adding

dstDoc.LastSection.PageSetup.SectionStart = SectionStart.NewPage;



If it does not help, then please attach the sample documents. I will check what could be done.

Best regards,