Table does not respect IsKeptWithNext value

Hi Team,

I’m experiencing an issue when it comes to keeping tables with some text following it on the same page.

        var document = new Document();
        document.PageInfo.DefaultTextState.FontSize = 30;
        var page = document.Pages.Add();
        var text = new TextFragment("Sample text");

        for (var i = 0; i < 21; i++)
        {
            page.Paragraphs.Add(text);
        }

        var table = new Table();
        table.IsKeptWithNext = true;
        var row = table.Rows.Add();
        var cell = row.Cells.Add();
        var cellText = new TextFragment("Cell content");
        cellText.TextState.FontSize = 30;
        cell.Paragraphs.Add(cellText);
        page.Paragraphs.Add(table);

        page.Paragraphs.Add(text);

This code produces the following pdf, where the table and the following text are on different pages, even though IsKeptWithNext is set to true.

image.png (48.0 KB)

@jkoromi

We have logged this problem in our issue tracking system as PDFNET-53253. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.