Saving word as PDF give wrong text alignment

Saving a docx as pdf give me bad formatting. The docs is created from a template, using mailmerge.
This happens both saving directry as pdf the merged doc, and saving before to docx (showing correct) and then reloading and saving as pdf.

Used aspose.words for .net v 22.2.0.

Attached the docx and output files (OK saved with word, KO saved with Aspose.NET). (94.4 KB)

Code is very simple:

        Document doc = new Document("output.docx");

Thanks and best regards,
Andrea Zanotto

@andrea.zanotto We are working on your request and will reply you soon.

@andrea.zanotto Could you please send us the input docx before MailMerge so that the fix could exactly meet your expectations?

template.docx (12.4 KB)

Here it is! And that’s the code I’ve used:

        string MyDir = @"./";
        Document document = new Document(Path.Combine(MyDir, "template.docx"));
        string[] values = {
            "MARIETTO CRESPI",
            "PSU Ufficio Personale e documenti persi - Mario Negri - Dortomindo",
            "20020 POPITTO LI",
        string[] fields = new string[] { "NREC", "LINE1", "LINE2", "LINE3", "LINE4" };

        document.MailMerge.Execute(fields, values);


        document.Save(Path.Combine(MyDir, "output.pdf"));

        Document doc = new Document(MyDir + "output.docx");
        doc.Save(Path.Combine(MyDir, "output2.pdf"));

@andrea.zanotto Thank you for additional information. We have reproduced and logged the issue as WORDSNET-23423. We will keep you informed and let you know once it has been resolved. We apologize for your inconvenience.

@andrea.zanotto Unfortunately, after discussion, it has been decided to postpone the issue resolution at this point. Please consider the following code as a workaround.

Document doc = new Document("output.docx");

The issues you have found earlier (filed as WORDSNET-23423) have been fixed in this Aspose.Words for .NET 23.10 update also available on NuGet.