TCPDF::getStringHeight( $w,  $txt,  $reseth = false,  $autopadding = true,  $cellpadding = '',  $border )

This method return the estimated height needed for printing a simple text string using the Multicell() method.


Description Description

Generally, if you want to know the exact height for a block of content you can use the following alternative technique:


Parameters Parameters

$w

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

$txt

(Required) (string) String for calculating his height

$reseth

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

Default value: false

$autopadding

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

Default value: true

$cellpadding

(Optional) (float) Internal cell padding, if empty uses default cell padding.

Default value: ''

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


Top ↑

Return Return

(float) Return the minimal height needed for multicell method for printing the $txt param.


Top ↑

Source Source

File: includes/lib/tcpdf/tcpdf.php


			

Top ↑

User Contributed Notes User Contributed Notes

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