Problems converting Word Files to PDF

Hello together,

I’m using Aspose.Words with .NET to convert Word files (docx) to PDF. Word files are always from the same Word template. In the file there are some Merge Fields. After convertig a Word file to PDF sometimes content of merge field is missing.

Example: first screenshot Word, second PDF. See second red box with value “BKP; BZE; BZL”. This is one merge field in Word. In the converted PDF it’s just “BKP”.
Word:

PDF:

In the logs I can’t find any warnings or errors.
If I convert manually such a Word file (File => Export as) everything is fine.

I use Aspose.Words 18.10 (old licence).
I only have a few lines of code.
Setting the licence:

Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Total.lic");

Creating a Document object and saving it as PDF:

Document doc = new Document(sourcePath + sourceFilename + ".docx");
doc.Save(targetPath + targetFilename + ".pdf");

Do you have any idea why in some cases a part of the content of a merge field is missing?

Thank you and regards,
Daniel

@Daniel_Richter Could you please attach your input and output documents here for testing? We will check the issue and provide you more information. Unfortunately, it is not possible to analyze the problem using screenshots.

Hi Alexey,

the input Word file and PDF output file:
BZ0000206_Short.docx (76.0 KB)
BZ0000206_Short.pdf (64.7 KB)

Regards,
Daniel

@Daniel_Richter Thank you for additional information. I cannot reproduce the problem on my side using the latest 23.2 version of Aspose.Words. Here is output document produced on my side: out.pdf (65.6 KB)

It looks like there is some problem with wrapping text in structured document tags in old version of Aspose.Words. I would suggest you to update to the more recent version of Aspose.Words.