Free Support Forum - aspose.com

Issue in document concatenation

Method moveToDocumentEnd() is not working properly.
Please see attached files that reproduces the issue. It is related to the circle located in the header. Aspose is trying to concatenate files inside of it instead of move to the end of the document. If I remove that circle, it works fine.
How to fix that?

@cpatricio76

Thanks for your inquiry. Please move to the last paragraph of document as following and insert document. It will resolve the issue.

.....
DocumentBuilder builder = new DocumentBuilder(srcDoc1);
builder.MoveTo(srcDoc1.LastSection.Body.LastParagraph);
builder.InsertParagraph();
builder.InsertDocument(srcDoc2, ImportFormatMode.KeepSourceFormatting);
.....

Indeed It worked fine. Thank you