We are facing merging issue with Aspose when document contains the shape line whereas it works fine with OpenXML . Attaching the corrected/Expected version (OpenXML Generated.docx) as well as the version generated with Aspose (Aspose Generated.docx). Also, the attachment is getting distorted.
Aspose Generated.docx (101.1 KB)
Attachment1.docx (37.0 KB)
Attachment2.docx (19.0 KB)
Attachment3.docx (50.0 KB)
Attachment4.docx (38.7 KB)
OpenXML Generated.docx (100.1 KB)
@NIKHIL.AGGARWAL30.OPTUM.COM Unfortunately, I cannot reproduce the problem on my side. I have used the following code for testing:
string[] docs = new string[] {
@"C:\Temp\Attachment1.docx",
@"C:\Temp\Attachment2.docx",
@"C:\Temp\Attachment3.docx",
@"C:\Temp\Attachment4.docx"
};
Document result = null;
foreach (string path in docs)
{
Document doc = new Document(path);
doc.FirstSection.PageSetup.SectionStart = SectionStart.NewPage;
doc.FirstSection.HeadersFooters.LinkToPrevious(false);
if (result == null)
result = doc;
else
result.AppendDocument(doc, ImportFormatMode.KeepSourceFormatting);
}
// Reset size of empty headers/footers.
NodeCollection headersFooters = result.GetChildNodes(NodeType.HeaderFooter, true);
foreach (HeaderFooter hf in headersFooters)
{
if (string.IsNullOrEmpty(hf.ToString(SaveFormat.Text).Trim()))
hf.FirstParagraph.ParagraphBreakFont.Size = 0;
}
result.Save(@"C:\Temp\out.docx");
The same I have suggested in another your thread.
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;
@NIKHIL.AGGARWAL30.OPTUM.COM Thank you for additional information. With the newly attached documents the problem is reproducible.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-24952
You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.
How much time it will take to resolve this issue?
Can I get respond on this issue as possible as.
@Dhanashri0709 We cannot provide you any estimates at the moment. Our development team will analyze the issue and then we will be able to provide you more information. You can obtain Paid Support services if you need support on a priority basis.
The issues you have found earlier (filed as WORDSNET-24952) have been fixed in this Aspose.Words for .NET 23.3 update also available on NuGet.