setasign\Fpdi\Tfpdf
FpdfTpl Class FpdfTpl
File: /FPDI v2/Tfpdf/FpdfTpl.php
We need to change some access levels and implement the setPageFormat() method to bring back compatibility to tFPDF.
Class hierarchy
Uses
Summary
Properties
$currentTemplateId
The template id for the currently created template.
Methods
AddPage()
Parameters
- $orientation
- $size
- $rotation
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