Different behavior of tab stops in different versions of Aspose.Words

Hello,

While trying newer versions of Aspose.Words for Java, I noticed a change in the behavior of tab stops. In version 24.10, the table becomes distorted after adding a tab stop.

Could you please confirm whether this is a bug in Aspose?

Code snippet:

Document doc = new Document(new FileInputStream("C:\\work\\table.docx"));

Table table = (Table) doc.getChild(NodeType.TABLE, 0, true);
Cell cell = table.getRows().get(2).getCells().get(0);

cell.getCellFormat().setPreferredWidth(PreferredWidth.AUTO);
cell.getLastParagraph().appendChild(new Run(doc, ControlChar.TAB));
cell.getLastParagraph().getParagraphFormat().getTabStops().add(
     700,
     TabAlignment.RIGHT,
     TabLeader.DOTS
);

doc.save("C:\\work\\new.pdf");

Word file:
table.docx (14.9 KB)

Difference between versions:

@dfinsolutions The latest version result is correct since it corresponds MS Word result. If you add such tab stop into the table using MS Word (or save the output as DOCX using Aspose.Words) you will see the same result. So there was a bug in older version, which was fixed in the newer one.

@alexey.noskov Thank you for your response. Is it possible to add dot leaders to a full cell when the cell width is unknown (Preferred width = auto)?

@dfinsolutions I am afraid, there is no way to achieve this, also I do not see a way to achieve this using MS Word. As an option, you can try setting doted line border for the paragraph inside cell, but in this case dots are from the beginning to the end of the cell.
test.docx (13.0 KB)