Hi @alexey.noskovAttachment2.docx (17.4 KB)
Attachment4_08022023.docx (38.7 KB)
Attachment3_08022023.docx (50.0 KB)
Attachment1.docx (32.4 KB)
I have tried your given solution with below attachments, but it is not working as expected.
Kindly check attached “AsposeLetterIssue”
I have noticed first letter is merging with second letter also line issue still persists. Also find the code and attachments i tried with.
I have tried with ImportFormatMode.KeepSourceFormatting
and ImportFormatMode.KeeyDifferentStyles
.
Also find the Aspose generated letter
AsposeLetterIssue.docx (85.1 KB)
Refer below code.
var output = new AsposeWord.Document();
// Remove all content from the destination document before appending.
output.RemoveAllChildren();
foreach (string fileName in files)
{
var input = new AsposeWord.Document(fileName);
input.FirstSection.PageSetup.SectionStart = SectionStart.NewPage;
input.FirstSection.HeadersFooters.LinkToPrevious(false);
// Append the source document to the end of the destination document.
output.AppendDocument(input, AsposeWord.ImportFormatMode.KeepDifferentStyles);
} // Reset size of empty headers/footers.
NodeCollection headersFooters = output.GetChildNodes(NodeType.HeaderFooter, true);
foreach (HeaderFooter hf in headersFooters)
{
if (string.IsNullOrEmpty(hf.ToString(SaveFormat.Text).Trim()))
hf.FirstParagraph.ParagraphBreakFont.Size = 0;
}
output.Save(mergedFile);
return mergedFile;