phpdftk API Documentation

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

Methods

__construct()

public __construct(int $pageNumber, int $totalPages, Page $page, float $pageWidth, float $pageHeight, Theme $theme) : mixed
Parameters
$pageNumber : int
$totalPages : int
$page : Page
$pageWidth : float
$pageHeight : float
$theme : Theme

        
On this page

Search results