TcpdfWrapper extends TCPDF
TCPDF Wrapper. Extends the TCPDF library to make it easier to use for building invoices.
Attributes
- #[AllowDynamicProperties]
Table of Contents
Properties
| $direction |
Methods
| __construct() | Initializes the TCPDF Wrapper |
| drawTable() | Draws a table using the given data and options |
| drawRow() | Renders the table row |
Methods
__construct()
Initializes the TCPDF Wrapper
public
__construct(string $orientation, string $unit, string $format, bool $unicode, string $encoding, bool $diskcache) : mixed
Parameters
- $orientation : string
-
The paper orientation (optional, default 'P')
- $unit : string
-
The measurement unit (optional, default 'mm')
- $format : string
-
The paper format (optional, default 'A4')
- $unicode : bool
-
True if the PDF should support unicode characters (optional, default true)
- $encoding : string
-
The character encoding (optional, default 'UTF-8')
- $diskcache : bool
-
True to cache results to disk (optional, default false)
drawTable()
Draws a table using the given data and options
protected
drawTable([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = null ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
-
An array of 'column' => values
- $options : array<string|int, mixed> = null
-
An array of options affecting the table including:
- type The type of table (multicell or cell, default 'multicell')
- x_pos The X position of the table (default current X post)
- y_pos The Y position of the table (default current Y pos)
- border Border thickness (default 0)
- align Table alignment (default L)
- text_color An RGB array of text color (default null, whatever the default text color is set to)
- font_size The font size for the table (default current font size)
- height The width of the cell(s) (default 0 - auto)
- width The height of the cell(s) (default 0 - to end of screen)
- font The font to set for the cell(s)
- font_style The font style for the cell(s) 'B' = bold, 'I' = italic, 'BI' = bold and italic, 'U' = underlined
- line_style The line style attributes (@see TCPDF::setLineStyle())
- fill_color The color to fill the cell(s) with
- padding The padding value to use for the cell(s) (null - auto padding)
- col All options from $options that affect the given column by name or index
- row All options from $options that affect the given row by index
- cell All options from $options that affect the given cell by both column and row
drawRow()
Renders the table row
private
drawRow(array<string|int, mixed> $row, int $i, array<string|int, mixed> $opt) : int
Parameters
- $row : array<string|int, mixed>
-
The row to render
- $i : int
-
The index of this row in the table
- $opt : array<string|int, mixed>
-
An array of render options
Return values
int —The maximum number of units required to render the height of the tallest cell