PdfGrid class Null safety

Represents a flexible grid that consists of columns and rows.

//Create a new PDF document
PdfDocument document = PdfDocument();
//Create a PdfGrid class
PdfGrid grid = PdfGrid();
//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
PdfGridRow row = grid.rows.add();
row.cells[0].value = 'E01';
row.cells[1].value = 'Clay';
row.cells[2].value = '\$10,000';
row = grid.rows.add();
row.cells[0].value = 'E02';
row.cells[1].value = 'Simon';
row.cells[2].value = '\$12,000';
//Set the grid style
grid.style = PdfGridStyle(
    cellPadding: PdfPaddings(left: 2, right: 3, top: 4, bottom: 5),
    backgroundBrush: PdfBrushes.blue,
    textBrush: PdfBrushes.white,
    font: PdfStandardFont(PdfFontFamily.timesRoman, 25));
//Draw the grid
grid.draw(
    page: document.pages.add(), bounds: const Rect.fromLTWH(0, 0, 0, 0));
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();
Inheritance

Constructors

PdfGrid()
Initializes a new instance of the PdfGrid class. [...]

Properties

allowRowBreakingAcrossPages bool
Gets or sets a value indicating whether to split or cut rows that overflow a page. [...]
read / write
beginCellLayout PdfGridBeginCellLayoutCallback?
The event raised on starting cell lay outing. [...]
read / write
beginPageLayout BeginPageLayoutCallback?
Raises before the element should be printed on the page.
read / write, inherited
columns PdfGridColumnCollection
Gets the column collection of the PdfGrid. [...]
read-only
endCellLayout PdfGridEndCellLayoutCallback?
The event raised on finished cell layout. [...]
read / write
endPageLayout EndPageLayoutCallback?
Raises after the element was printed on the page.
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
headers PdfGridHeaderCollection
Gets the headers collection from the PdfGrid. [...]
read-only
repeatHeader bool
Gets or sets a value indicating whether to repeat header. [...]
read / write
rows PdfGridRowCollection
Gets the row collection from the PdfGrid. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
style PdfGridStyle
Gets the grid style. [...]
read / write

Methods

applyBuiltInStyle(PdfGridBuiltInStyle gridStyle, {PdfGridBuiltInStyleSettings? settings}) → void
Apply built-in table style to the table [...]
draw({Rect? bounds, PdfLayoutFormat? format, PdfGraphics? graphics, PdfPage? page}) PdfLayoutResult?
Draws the PdfGrid [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited