phpdftk API Documentation

TableRenderer
in package

FinalYes

Renders {@see Table} content into a {@see ContentStream}. The renderer is stateless and reusable; pagination logic lives at the call site (`Pdf::addTable` measures each row and starts a new page when needed).

Coordinates: $y is the y-coordinate of the top edge of the row; the row is drawn downward and the returned float is the height consumed.

Table of Contents

Methods

drawRow()  : float
Draw one row at (x, y). Returns the height consumed so the caller can advance its cursor.
rowHeight()  : float
Height a single row needs, in points, after greedy word-wrap.

Methods

drawRow()

Draw one row at (x, y). Returns the height consumed so the caller can advance its cursor.

public drawRow(ContentStream $cs, float $x, float $y, array<int, string> $row, array<int, float> $widths, TableRenderContext $ctx, bool $isHeader) : float
Parameters
$cs : ContentStream
$x : float
$y : float
$row : array<int, string>
$widths : array<int, float>
$ctx : TableRenderContext
$isHeader : bool
Return values
float

rowHeight()

Height a single row needs, in points, after greedy word-wrap.

public rowHeight(array<int, string> $row, array<int, float> $widths, TableRenderContext $ctx, bool $isHeader) : float
Parameters
$row : array<int, string>
$widths : array<int, float>
$ctx : TableRenderContext
$isHeader : bool
Return values
float

        
On this page

Search results