Inconsistency between Word and PDF documents containing tables and "Keep with next" settings

Hello, When saving document containing a table with specific “Keep with next” setup within cells, we get differences between generated Word and PDF content. In PDF the table is fitted into first page, while in Word it is placed on the second one. Here is a sample code snippet which allows to reproduce that issue:

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

PageSetup pageSetup = builder.getPageSetup();
pageSetup.setOrientation(Orientation.PORTRAIT);
pageSetup.setPaperSize(PaperSize.CUSTOM);
pageSetup.setPageWidth(ConvertUtil.inchToPoint(4.13));
pageSetup.setPageHeight(ConvertUtil.inchToPoint(5.83));

builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu urna lacinia velit congue hendrerit. In fringilla orci sodales risus viverra, eget suscipit mi aliquam. Aliquam erat volutpat. Maecenas finibus dolor nibh, eleifend molestie orci mollis in. Vivamus vitae turpis vitae ipsum auctor auctor sed in elit.");

builder.getCurrentParagraph().getParagraphFormat().setKeepWithNext(true);
builder.writeln("Table:");

builder.startTable();
for (int i = 1; i <= 7; i++)
{
    builder.insertCell();
    if (i == 7)
    {
        builder.getCurrentParagraph().getParagraphFormat().setKeepWithNext(false);
    }
    builder.write("Cell" + i);
    builder.endRow();
}
builder.endTable();

document.save("Document.docx");
document.save("Document.pdf");

@ANDREA.FARRIS
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): WORDSJAVA-2885

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.