Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

This file is part of FPDI

Copyright: Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com)
License: http://opensource.org/licenses/mit-license The MIT License
File Size: 470 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 17 functions


Functions that are not part of a class:

setPageFormat($size, $orientation)   X-Ref
Set the page format of the current page.

param: array $size An array with two values defining the size.
param: string $orientation "L" for landscape, "P" for portrait.

useTemplate($tpl, $x = 0, $y = 0, $width = null, $height = null, $adjustPageSize = false)   X-Ref
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.

param: mixed $tpl The template id
param: array|float|int $x The abscissa of upper-left corner. Alternatively you could use an assoc array
param: float|int $y The ordinate of upper-left corner.
param: float|int|null $width The width.
param: float|int|null $height The height.
param: bool $adjustPageSize
return: array The size

getTemplateSize($tpl, $width = null, $height = null)   X-Ref
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.

param: mixed $tpl The template id
param: float|int|null $width The width.
param: float|int|null $height The height.
return: array|bool An array with following keys: width, height, 0 (=width), 1 (=height), orientation (L or P)

beginTemplate($width = null, $height = null, $groupXObject = false)   X-Ref
Begins a new template.

param: float|int|null $width The width of the template. If null, the current page width is used.
param: float|int|null $height The height of the template. If null, the current page height is used.
param: bool $groupXObject Define the form XObject as a group XObject to support transparency (if used).
return: int A template identifier.

endTemplate()   X-Ref
Ends a template.

return: bool|int|null A template identifier.

getNextTemplateId()   X-Ref
Get the next template id.

return: int

AddPage($orientation = '', $size = '', $rotation = 0)   X-Ref


Link($x, $y, $w, $h, $link)   X-Ref


SetLink($link, $y = 0, $page = -1)   X-Ref


SetDrawColor($r, $g = null, $b = null)   X-Ref


SetFillColor($r, $g = null, $b = null)   X-Ref


SetLineWidth($width)   X-Ref


SetFont($family, $style = '', $size = 0)   X-Ref


SetFontSize($size)   X-Ref


_putimages()   X-Ref


_putxobjectdict()   X-Ref


_out($s)   X-Ref