Footer issues

We have implemented the Aspose mail merge functionality, but we are facing several issues with the footer formatting when compared to the original document:

  1. Footer Font Size Increase:
    After the mail merge, the footer font size has increased noticeably and does not match the original document’s formatting.

  2. Unexpected Footer Addition:
    The original document does not contain a footer , but the mail merge process adds a footer to that page unexpectedly.

  3. Font Issues in Footer Line:
    The font in the footer line after mail merge shows inconsistencies, including irregular style, size, and alignment.

These issues are affecting the overall layout and visual consistency of the generated documents. Could you please provide guidance or a solution to preserve the original footer formatting during the mail merge?

@Srinithin Could you please attach your template, problematic and expected output along with runnable code that will allow us to reproduce the problem? We will check the issue and provide you more information. Unfortunately, screenshots do not give enough information for analysis.

fontissuesinfooterline.docx (28.0 KB)

footerfontsizeincrease.docx (33.6 KB)

unexpectedfooteraddition1.docx (25.6 KB)

unexpectedfooteraddition2.docx (15.8 KB)

Unexpected Footer Addition: When reproducing the mail merge order, ‘unexpectedfooteraddition1’ appears first, followed by ‘unexpectedfooteraddition2’.
Order 1: unexpectedfooteraddition1
Order 2: unexpectedfooteraddition2

@Srinithin Thank you for additional information.

  1. The problem is not reproducible on my side. Code for testing:
Document doc = new Document(@"C:\Temp\fontissuesinfooterline.docx");
// Execute mail merge with dummy data.
doc.MailMerge.Execute(new string[] { "LoanNbr", "Borrower1POA", "Borrower2POA", "Borrower3POA", "Borrower4POA" }, new string[] { "LoanNbr", "Borrower1POA", "Borrower2POA", "Borrower3POA", "Borrower4POA" });
doc.Save(@"C:\Temp\fontissuesinfooterline_out.docx");

Here is the produced output: fontissuesinfooterline_out.docx (12.2 KB)

  1. The problem is not reproducible on my side. Code for testing:
Document doc = new Document(@"C:\Temp\footerfontsizeincrease.docx");
// Execute mail merge with dummy data.
string[] names = new string[] { "LoanNbr", "BorrowerString", "PropertyStreet", "PropertyCity", "PropertyState", "PropertyZip", "BorrowerString", "LenderName", "TotalModBalance", "Borrower1POA", "Borrower2POA", "Borrower3POA", "Borrower4POA" };
doc.MailMerge.Execute(names, names);
doc.Save(@"C:\Temp\footerfontsizeincrease_out.docx");

Here is the produced output: footerfontsizeincrease_out.docx (17.9 KB)

  1. The problem is not reproducible on my side. Code for testing:
Document doc = new Document(@"C:\Temp\unexpectedfooteraddition1.docx");
// Execute mail merge with dummy data.
string[] names = new string[] { "DocMonth", "DocDay", "DocYear", "BorrowerString", "BorrowerStreet", "BorrowerCity", "BorrowerState", "BorrowerZip", "LoanNbr", "PropertyStreet", "PropertyCity", "PropertyState", "PropertyZip", "BorrowerString", "BorrowerContribution" };
doc.MailMerge.Execute(names, names);
doc.Save(@"C:\Temp\unexpectedfooteraddition1_out.docx");

Here is the produced output: unexpectedfooteraddition1_out.docx (16.0 KB)

  1. The problem is not reproducible on my side. Code for testing:
Document doc = new Document(@"C:\Temp\unexpectedfooteraddition.docx");
// Execute mail merge with dummy data.
string[] names = new string[] { "LoanNbr" };
doc.MailMerge.Execute(names, names);
doc.Save(@"C:\Temp\unexpectedfooteraddition_out.docx");

Here is the produced output: unexpectedfooteraddition_out.docx (10.7 KB)

Steps to Reproduce the Issue:

Try combining the documents in the same order you used when the issue occurred.

The correct document order should be:

order 1 :
order 1.docx (25.8 KB)

order 2 :
unexpectedfooteraddition.docx (15.8 KB)

order 3 :
footerfontsizeincrease.docx (33.6 KB)

order 4 :
fontissuesinfooterline.docx (28.0 KB)

@Srinithin Please try using Merger class to merge documents:

Merger.Merge(@"C:\Temp\out.docx", new string[] { @"C:\Temp\1.docx", @"C:\Temp\2.docx", @"C:\Temp\3.docx", @"C:\Temp\4.docx" }, SaveFormat.Docx, MergeFormatMode.KeepSourceLayout);

or

MergerContext context = new MergerContext();
context.MergeFormatMode = MergeFormatMode.KeepSourceLayout;

Merger.Create(context)
    .From(@"C:\Temp\1.docx")
    .From(@"C:\Temp\2.docx")
    .From(@"C:\Temp\3.docx")
    .From(@"C:\Temp\4.docx")
    .To(@"C:\Temp\out.docx")
    .Execute();

out.docx (37.3 KB)

Thank you for your support. Could you please save the output in PDF format with the combination order shown above? That issue is being caused by it

@Srinithin Here is PDF document produced by the following code:

MergerContext context = new MergerContext();
context.MergeFormatMode = MergeFormatMode.KeepSourceLayout;

Merger.Create(context)
    .From(@"C:\Temp\1.docx")
    .From(@"C:\Temp\2.docx")
    .From(@"C:\Temp\3.docx")
    .From(@"C:\Temp\4.docx")
    .To(@"C:\Temp\out.pdf")
    .Execute();

out.pdf (108.7 KB)