FpdfTrait
This trait is used for the implementation of FPDI in FPDF and tFPDF.
Table of Contents
Methods
- getTemplateSize() : array<string|int, mixed>|bool
- Get the size of an imported page or template.
- useTemplate() : array<string|int, mixed>
- Draws an imported page or a template onto the page or another template.
- _enddoc() : mixed
- _put() : mixed
- _putimages() : mixed
- _putlinks() : void
- _putxobjectdict() : mixed
Methods
getTemplateSize()
Get the size of an imported page or template.
public
getTemplateSize(mixed $tpl[, float|int|null $width = null ][, float|int|null $height = null ]) : array<string|int, mixed>|bool
Give only one of the size parameters (width, height) to calculate the other one automatically in view to the aspect ratio.
Parameters
- $tpl : mixed
-
The template id
- $width : float|int|null = null
-
The width.
- $height : float|int|null = null
-
The height.
Return values
array<string|int, mixed>|bool —An array with following keys: width, height, 0 (=width), 1 (=height), orientation (L or P)
useTemplate()
Draws an imported page or a template onto the page or another template.
public
useTemplate(mixed $tpl[, float|int|array<string|int, mixed> $x = 0 ][, float|int $y = 0 ][, float|int|null $width = null ][, float|int|null $height = null ][, bool $adjustPageSize = false ]) : array<string|int, mixed>
Give only one of the size parameters (width, height) to calculate the other one automatically in view to the aspect ratio.
Parameters
- $tpl : mixed
-
The template id
- $x : float|int|array<string|int, mixed> = 0
-
The abscissa of upper-left corner. Alternatively you could use an assoc array with the keys "x", "y", "width", "height", "adjustPageSize".
- $y : float|int = 0
-
The ordinate of upper-left corner.
- $width : float|int|null = null
-
The width.
- $height : float|int|null = null
-
The height.
- $adjustPageSize : bool = false
Tags
Return values
array<string|int, mixed> —The size
_enddoc()
protected
_enddoc() : mixed
_put()
protected
_put(mixed $s[, mixed $newLine = true ]) : mixed
Parameters
- $s : mixed
- $newLine : mixed = true
_putimages()
protected
_putimages() : mixed
Tags
_putlinks()
protected
_putlinks(int $n) : void
Parameters
- $n : int
Tags
_putxobjectdict()
protected
_putxobjectdict() : mixed