Formatting issue observered with new version of Aspose dll version V23

@alexey.noskov Please refer to the POC solution created by me location in discussion thread above. Find the snippet for same

use the following documents and copy paste into \Document folder

623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-1.docx (11.6 KB)

623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-2.docx (12.9 KB)

623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-3.docx (13.3 KB)

623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-4.docx (13.5 KB)

623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-5.docx (13.7 KB)

In AsposeV23PDFPopulator.cs change the following lines as (This is to generate pdf of shared document above)

foreach (System.Xml.XmlElement subDoc in subDocs)
{
    string sourceFile = GetSubdocSourceFile($"{rootPath}\\623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-1.docx", subDoc);
    finalDocument = AddSubDoc(sourceFile, subDoc);
}

In AddSubDoc document method reference the document attached as

try
{
    // Load the additional documents to be appended
    Aspose.Words.Document Subdoc1 = new Aspose.Words.Document($"{rootPath}\\623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-2.docx");
    Aspose.Words.Document Subdoc2 = new Aspose.Words.Document($"{rootPath}\\623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-3.docx");
    Aspose.Words.Document Subdoc3 = new Aspose.Words.Document($"{rootPath}\\623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-4.docx");
    Aspose.Words.Document Subdoc4 = new Aspose.Words.Document($"{rootPath}\\623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-5.docx");

    // Append the documents to the main document
    mainDoc.AppendDocument(Subdoc1, ImportFormatMode.KeepSourceFormatting);
    mainDoc.AppendDocument(Subdoc2, ImportFormatMode.KeepSourceFormatting);
    mainDoc.AppendDocument(Subdoc3, ImportFormatMode.KeepSourceFormatting);
    mainDoc.AppendDocument(Subdoc4, ImportFormatMode.KeepSourceFormatting);

Input given as

Output coming as

@omkars Thank you for additional information. I finally managed to reproduce the problem on my side. It can be reproduced by simple conversion of 623e9540-f174-40c0-9dba-e028a79df6ba-MC_CovLineBodilyInjury_3_t-5.docx document to PDF.

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-27399

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.

Hello @alexey.noskov , Additionally we also found below issues, here header of table is shifting towards right compared to input doc. And we also observed output is different in v14 and v23. Aspose v14 was working correctly.

Input doc-

v23 Output

v14 Output

Please find below screenshots our client faced alignment issues, which was working fine in v14

v23 Output


v14 Output

Attached below input docx
MC_PremiumSection.docx (15.9 KB)

MC_Header_Cov_Line.docx (17.3 KB)
MC_CovLineBodilyInjury_notWorking.docx (17.0 KB)

MC_CovLinePropertyDamage.docx (16.9 KB)

MC_CovLineMedicalPayments_5.docx (17.0 KB)

MC_CovLineUninsuredMotoristBodilyInjury_6.docx (17.0 KB)

Attached below v23 output pdf
v23_OutputPDF.pdf (54.3 KB)

@soma.das Looks like the same problem as WORDSNET-27399. We will keep you informed and let you know once it is resolved.

@alexey.noskov can you able to tell us what word docs cause this problem? is there a specific criterion to check those forms which would cause an issue for aspose during merge and conversion?

@osakpal The issue occurs because MS Word merges adjacent tables with different indents, and Aspose.Words does not.

The document appears to be generated by Aspose.Words. In the source xml, there are three consecutive w:tbl elements. MS Word treats them as a single table. Aspose.Words does not merge the tables because of different table attributes. Specifically, table 1 and table 2 have different left indents specified. Apparently, the logic that checks if a pair of tables can be merged should be revised.

For now the issue has been postponed and is not yet scheduled for development.