-
-
Save bjoerntx/a002e883ff32e736b64fe091d693b161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find the first table row on the next page | |
private TableRow FindFirstTableRowOnNextPage(Table table, TableRow startTableRow = null) { | |
if (startTableRow == null) { | |
startTableRow = table.Rows.GetItem(1); | |
} | |
int tableStart = table.Cells.GetItem(startTableRow.Row, 1).Start; | |
int tableStartPage = textControl1.GetPages().GetItem(tableStart).Number; | |
TableRow row = null; | |
// If the table is not across pages, | |
for (int i = startTableRow.Row + 1; i <= table.Rows.Count; i++) { | |
row = table.Rows.GetItem(i); | |
int rowStart = table.Cells.GetItem(row.Row, 1).Start; | |
// return the first row on the next page | |
if (textControl1.GetPages().GetItem(rowStart).Number > tableStartPage) { | |
break; | |
} | |
} | |
return row; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment