PageContext
in package
FinalYes
Context passed to per-page render hooks (header / footer / watermark).
Closures registered via Pdf::setHeader(), Pdf::setFooter(), or Pdf::setWatermark() receive this object so they can draw on the page with full knowledge of which page they're on, how many pages the final document will contain, and the page's geometry.
Note: the closure runs in a deferred pass after all flow content has
been placed, which is why totalPages is reliably set — unlike in
the middle of addText() calls, where the document is still growing.
Table of Contents
Properties
- $page : Page
- $pageHeight : float
- $pageNumber : int
- $pageWidth : float
- $theme : Theme
- $totalPages : int
Methods
- __construct() : mixed
Properties
$page read-only
public
Page
$page
$pageHeight read-only
public
float
$pageHeight
$pageNumber read-only
public
int
$pageNumber
$pageWidth read-only
public
float
$pageWidth
$theme read-only
public
Theme
$theme
$totalPages read-only
public
int
$totalPages
Methods
__construct()
public
__construct(int $pageNumber, int $totalPages, Page $page, float $pageWidth, float $pageHeight, Theme $theme) : mixed