Two line header cell split between first and second page

The header cell should have text “Max Level of Injury”
I have “Max Level of” on the first page and “Injury” on the following pages.
This happens for certain string length, or rather rendered string size.
If I use different string it will wrap in two lines just fine.

page1.png (29.1 KB)

page2.png (37.6 KB)

@sklepikov

Would you please share your complete sample code snippet and sample PDF document for our reference? We will test the scenario in our environment and address it accordingly.

test.pdf (106.2 KB)

ExportToPdf.zip (5.8 KB)

@sklepikov

We changed below method (added two lines at the last) in your code and generated output was fine:

private Aspose.Pdf.Table CreateTableDesign(int columnCount)
{
    var table = new Aspose.Pdf.Table();
    if (columnCount == 0) columnCount = 1;
    int width = 792 / columnCount;
    table.ColumnWidths = width.ToString();
    table.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
    // Set the border for table cells
    table.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, .5f, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray));
    table.DefaultCellPadding = new MarginInfo(2, 2, 2, 2);
    table.DefaultCellTextState.HorizontalAlignment = HorizontalAlignment.Center;
    // Create a loop to add 10 rows
    table.DefaultCellTextState.FontSize = 8;
    table.RepeatingRowsCount = 1;
    table.IsBordersIncluded = true;
    table.Margin = new MarginInfo(0, 0, 0, 0);

    return table;
}

test.pdf (22.9 KB)

Thank you for the quick response.
The change does work for a few tests I’ve run.
Will do more tests shortly.

@sklepikov

It is nice to know that things have started working correctly. Please feel free to create a new topic in case you need further assistance.