setasign\Fpdi
FpdfTplTrait Trait FpdfTplTrait
File: /FPDI v2/FpdfTplTrait.php
This trait adds a templating feature to FPDF and tFPDF.
Used in
Summary
Properties
$currentTemplateId
The template id for the currently created template.
Methods
beginTemplate()
Begins a new template.
Parameters
- $width : float|int|null
The width of the template. If null, the current page width is used.
- $height : float|int|null
The height of the template. If null, the current page height is used.
- $groupXObject : bool
Define the form XObject as a group XObject to support transparency (if used).
Return Values
A template identifier.
getTemplateSize()
Get the size of a template.
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
The width.
- $height : float|int|null
The height.
Return Values
An array with following keys: width, height, 0 (=width), 1 (=height), orientation (L or P)
setPageFormat()
Set the page format of the current page.
Parameters
- $size : array
An array with two values defining the size.
- $orientation : string
"L" for landscape, "P" for portrait.
Exceptions
Throws \BadMethodCallException
useTemplate()
Draws a template onto the page or another template.
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 : array|float|int
The abscissa of upper-left corner. Alternatively you could use an assoc array with the keys "x", "y", "width", "height", "adjustPageSize".
- $y : float|int
The ordinate of upper-left corner.
- $width : float|int|null
The width.
- $height : float|int|null
The height.
- $adjustPageSize : bool
Return Values
The size