Issue exporting table with AUTO preferred cell width to PDF

Hello,

We have identified a formatting difference between export to DOCX and PDF when exporting a table with AUTO preferred cell width. Can you please investigate?

Code snippet for the most basic table where this can be reproduced:

Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);

//Insert a table
builder.startTable();

Cell cell1 = builder.insertCell();
//Add two strings to the firt cell to highlight the new line difference in export
builder.write("test test");

Cell cell2 = builder.insertCell();
//Add a long string to the second cell that forces new line in the first cell
builder.write("AaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA");

builder.endRow();
builder.endTable();

//Set preferred width to auto for both cells
cell1.getCellFormat().setPreferredWidth(PreferredWidth.AUTO);
cell2.getCellFormat().setPreferredWidth(PreferredWidth.AUTO);

PDF export:

DOCX export:

Aspose.WORDS version: 24.9
Aspose.PDF version: 22.2

@dfinsolutions Unfortunately, I cannot reproduce the problem on my side using the latest 24.12 version of Aspose.Words. Here are output documents generated using the above code on my side:
out.docx (7.3 KB)
out.pdf (15.8 KB)

@alexey.noskov thanks for looking into this. We are still able to reproduce this issue on 24.12, however it looks to be related to OoxmlCompliance option we use when exporting to DOCX. It appears to work incorrectly with ISO_29500_2008_STRICT and correctly with ISO_29500_2008_TRANSITIONAL.

@dfinsolutions
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-27687

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.