Just one day after submitting the wrong implement of getNumLines for TCPDF, the issue is closed for invalid. The reason is you can get the actual number of lines by using transaction, like this:
// store current object $pdf->startTransaction(); // get the number of lines for multicell $lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0); // restore previous object $pdf = $pdf->rollbackTransaction();
Isn't it easier this way ?
$lines = $pdf->getNumLines($txt,$w)
I don't really understand, why we have to use transaction, when we can fix the getNumLines to return correct value, instead of estimated number of lines. And using transaction consumes more resources too . I guess sometime people want to choose the hardway ... :(
Add new comment