MYPDF::getHtmlStringLines PHP Method

getHtmlStringLines() public method

Split the string in lines and check if a line would overflow and cause more lines.
public getHtmlStringLines ( string $string, integer $line_width ) : integer
$string string Text to check.
$line_width integer
return integer Number of lines the text will need.
    public function getHtmlStringLines($string, $line_width)
    {
        $htmlLines = explode("<br />", $string);
        $lineCount = count($htmlLines);
        foreach ($htmlLines as $line) {
            $lineCount += ceil($this->GetStringWidth($line) / $line_width);
        }
        return $lineCount;
    }