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.

$templateId

A counter for template ids.

$templates

protected array \setasign\Fpdi\FpdfTplTrait::$templates = array()

Data of all created templates.


Methods

AddPage()

public \setasign\Fpdi\FpdfTplTrait::AddPage (
[ $orientation = '' [, $size = '' [, $rotation = 0 ]]]
): void
Parameters
$orientation
 
$size
 
$rotation
 

Link()

public \setasign\Fpdi\FpdfTplTrait::Link (
$x, $y, $w, $h, $link
): void
Parameters
$x
 
$y
 
$w
 
$h
 
$link
 

SetDrawColor()

public \setasign\Fpdi\FpdfTplTrait::SetDrawColor (
$r [, $g = null [, $b = null ]]
): void
Parameters
$r
 
$g
 
$b
 

SetFillColor()

public \setasign\Fpdi\FpdfTplTrait::SetFillColor (
$r [, $g = null [, $b = null ]]
): void
Parameters
$r
 
$g
 
$b
 

SetFont()

public \setasign\Fpdi\FpdfTplTrait::SetFont (
$family [, $style = '' [, $size = 0 ]]
): void
Parameters
$family
 
$style
 
$size
 

SetFontSize()

Parameters
$size
 

SetLineWidth()

public \setasign\Fpdi\FpdfTplTrait::SetLineWidth (
$width
): void
Parameters
$width
 

SetLink()

public \setasign\Fpdi\FpdfTplTrait::SetLink (
$link [, $y = 0 [, $page = -1 ]]
): void
Parameters
$link
 
$y
 
$page
 

_out()

public \setasign\Fpdi\FpdfTplTrait::_out (
$s
): void
Parameters
$s
 

_putimages()

protected \setasign\Fpdi\FpdfTplTrait::_putimages (
void
): void

_putxobjectdict()

beginTemplate()

public \setasign\Fpdi\FpdfTplTrait::beginTemplate (
[ float|int|null $width = null [, float|int|null $height = null [, bool $groupXObject = false ]]]
): int

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.

endTemplate()

public \setasign\Fpdi\FpdfTplTrait::endTemplate (
void
): bool|int|null

Ends a template.

Return Values

A template identifier.

getNextTemplateId()

Get the next template id.

getTemplateSize()

public \setasign\Fpdi\FpdfTplTrait::getTemplateSize (
mixed $tpl [, float|int|null $width = null [, float|int|null $height = null ]]
): array|bool

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()

public \setasign\Fpdi\FpdfTplTrait::setPageFormat (
array $size, string $orientation
): void

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()

public \setasign\Fpdi\FpdfTplTrait::useTemplate (
mixed $tpl [, array|float|int $x = 0 [, float|int $y = 0 [, float|int|null $width = null [, float|int|null $height = null [, bool $adjustPageSize = false ]]]]]
): array

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

See