TCPDF::MultiCell( $w,  $h,  $txt,  $border,  $align = 'J',  $fill = false,  $ln = 1,  $x = '',  $y = '',  $reseth = true,  $stretch,  $ishtml = false,  $autopadding = true,  $maxh,  $valign = 'T',  $fitcell = false )

This method allows printing text with line breaks.


Description Description

They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
Text can be aligned, centered or justified. The cell block can be framed and the background painted.

See also See also

  • SetFont(),: SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak()

Top ↑

Parameters Parameters

$w

(Required) (float) Width of cells. If 0, they extend up to the right margin of the page.

$h

(Required) (float) Cell minimum height. The cell extends automatically if needed.

$txt

(Required) (string) String to print

$border

(Required) (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))

$align

(Optional) (string) Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align</li><li>C: center</li><li>R: right align</li><li>J: justification (default value when $ishtml=false)</li></ul>

Default value: 'J'

$fill

(Optional) (boolean) Indicates if the cell background must be painted (true) or transparent (false).

Default value: false

$ln

(Optional) (int) Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right</li><li>1: to the beginning of the next line [DEFAULT]</li><li>2: below</li></ul>

Default value: 1

$x

(Optional) (float) x position in user units

Default value: ''

$y

(Optional) (float) y position in user units

Default value: ''

$reseth

(Optional) (boolean) if true reset the last cell height (default true).

Default value: true

$stretch

(Required) (int) font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible.

$ishtml

(Optional) (boolean) INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods.

Default value: false

$autopadding

(Optional) (boolean) if true, uses internal padding and automatically adjust it to account for line width.

Default value: true

$maxh

(Required) (float) maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.

$valign

(Optional) (string) Vertical alignment of text (requires $maxh = $h > 0). Possible values are:<ul><li>T: TOP</li><li>M: middle</li><li>B: bottom</li></ul>. This feature works only when $ishtml=false and the cell must fit in a single page.

Default value: 'T'

$fitcell

(Optional) (boolean) if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h.

Default value: false


Top ↑

Return Return

(int) Return the number of cells or 1 for html mode.


Top ↑

Source Source

File: includes/lib/tcpdf/tcpdf.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
1.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.