Hi
Getting Page breaks in between merged documents - how to remove page breaking?
We have merged the Documents using below code
Found the below issues
-
Line break was deleted Line break was deleted Original.PNG (7.2 KB)
Line break was deleted.PNG (13.9 KB) -
Style of Paragraph was changed Original Style of Paragraph was changed.PNG (12.7 KB)
Style of Paragraph was changed.PNG (13.9 KB)Aspose.Words.Document TargetDoc = new Aspose.Words.Document(); string[] FilePaths = new string[2]; FilePaths.add(@"D:\Source 1.doc"); FilePaths.add(@"D:\Source 2.doc"); FilePaths.add(@"D:\Source 3.doc"); foreach (var FilePath in FilePaths) { Aspose.Words.Document DocItem= new Aspose.Words.Document(FilePath); case 1 //TargetDoc.AppendDocument(DocItem, ImportFormatMode.KeepDifferentStyles); case 2 TargetDoc.RemoveAllChildren(); DocItem.FirstSection.HeadersFooters.LinkToPrevious(false); Aspose.Words.Run pageBreakRun = new Aspose.Words.Run(DocItem, ControlChar.PageBreak); DocItem.FirstSection.Body.LastParagraph.AppendChild(pageBreakRun); TargetDoc.AppendDocument(DocItem, ImportFormatMode.KeepSourceFormatting);<a class="attachment" href="/uploads/default/28246">Word Merge issue.zip</a> (23.3 KB) } TargetDoc.Save(@"D://Case1Result.doc");
Find the reference Documents for the above code.Word Merge issue.zip (23.3 KB)
Find the expected file in above attachment.
Please provide the solution