FPDF_TPL Class FPDF_TPL
File: /FPDI v1/fpdf_tpl.php
Class hierarchy
Summary
Properties
$tplPrefix
Name prefix of templates used in Resources dictionary
A String defining the Prefix used as Template-Object-Names. Have to begin with an /
Methods
AddLink()
Creates a new internal link and returns its identifier.
Overwritten because adding links in a template will not work.
See
AddPage()
Adds a new page to the document.
See FPDF/TCPDF documentation.
This method cannot be used if you'd started a template.
Parameters
- $orientation
- $format
- $rotationOrKeepmargins
- $tocpage
See
Image()
Puts an image.
See FPDF/TCPDF documentation.
Parameters
- $file
- $x
- $y
- $w
- $h
- $type
- $link
- $align
- $resize
- $dpi
- $palign
- $ismask
- $imgmask
- $border
- $fitbox
- $hidden
- $fitonpage
- $alt
- $altimgs
See
Link()
Puts a link on a rectangular area of the page.
Overwritten because adding links in a template will not work.
Parameters
- $x
- $y
- $w
- $h
- $link
- $spaces
See
SetFont()
SetLink()
Defines the page and position a link points to.
Overwritten because adding links in a template will not work.
Parameters
- $link
- $y
- $page
See
_putimages()
Output images.
Overwritten to add _putformxobjects() after _putimages().
_putxobjectdict()
Writes the references of XObject resources to the document.
Overwritten to add the the templates to the XObject resource dictionary.
beginTemplate()
Start a template.
This method starts a template. You can give own coordinates to build an own sized template. Pay attention, that the margins are adapted to the new template size. If you want to write outside the template, for example to build a clipped template, you have to set the margins and "cursor"-position manual after beginTemplate()-call.
If no parameter is given, the template uses the current page-size. The method returns an id of the current template. This id is used later for using this template. Warning: A created template is saved in the resulting PDF at all events. Also if you don't use it after creation!
Parameters
- $x : int
The x-coordinate given in user-unit
- $y : int
The y-coordinate given in user-unit
- $w : int
The width given in user-unit
- $h : int
The height given in user-unit
Return Values
The id of new created template
Exceptions
Throws LogicException
endTemplate()
End template.
This method ends a template and reset initiated variables collected in beginTemplate().
Return Values
If a template is opened, the id is returned. If not a false is returned.
getTemplateSize()
Get the calculated size of a template.
If one size is given, this method calculates the other one.
Parameters
- $tplIdx : int
A valid template-id
- $w : int
The width of the template
- $h : int
The height of the template
Return Values
The height and width of the template (array('w' => ..., 'h' => ...))
useTemplate()
Use a template in current page or other template.
You can use a template in a page or in another template. You can give the used template a new size. All parameters are optional. The width or height is calculated automatically if one is given. If no parameter is given the origin size as defined in beginTemplate() method is used.
The calculated or used width and height are returned as an array.
Parameters
- $tplIdx : int
A valid template-id
- $x : int
The x-position
- $y : int
The y-position
- $w : int
The new width of the template
- $h : int
The new height of the template
Return Values
The height and width of the template (array('w' => ..., 'h' => ...))