repeatHeader property

bool repeatHeader
getter/setter pair

Gets or sets a value indicating whether to repeat header.

//Create a new PDF document
PdfDocument document = PdfDocument();
//Create a PdfGrid class
PdfGrid grid = PdfGrid();
//Sets repeatHeader
grid.repeatHeader = true;
//Add the columns to the grid
grid.columns.add(count: 3);
//Add header to the grid
grid.headers.add(1);
//Add the rows to the grid
PdfGridRow header = grid.headers[0];
header.cells[0].value = 'Employee ID';
header.cells[1].value = 'Employee Name';
header.cells[2].value = 'Salary';
//Add rows to grid
for (int i = 0; i < 500; i++) {
  final PdfGridRow row = grid.rows.add();
  row.cells[0].value = 'Row - $i Cell - 1';
  row.cells[1].value = 'Row - $i Cell - 2';
  row.cells[2].value = 'Row - $i Cell - 3';
}
//Draw the grid
grid.draw(
    page: document.pages.add(), bounds: Rect.zero);
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

late bool repeatHeader;