html2pdf icon indicating copy to clipboard operation
html2pdf copied to clipboard

count(): Parameter must be an array or an object that implements Countable / Html2Pdf.php:5150

Open 1YalcinSahin1 opened this issue 5 years ago • 2 comments

Hi,

I got this error when trying to create a PDF.

count(): Parameter must be an array or an object that implements Countable

What is the cause of the problem? Do you have an idea?

Thank you.

1YalcinSahin1 avatar Jul 27 '20 06:07 1YalcinSahin1

I skipped this problem as follows:

      if (is_array(self::$_tables[$param['num']]['height']) && count(self::$_tables[$param['num']]['height'])>1) {
                $y = $this->_margeTop+self::$_tables[$param['num']]['height'][count(self::$_tables[$param['num']]['height'])-1];
            } elseif (is_array(self::$_tables[$param['num']]['height']) && count(self::$_tables[$param['num']]['height']) == 1) {
                $y = self::$_tables[$param['num']]['curr_y']+self::$_tables[$param['num']]['height'][count(self::$_tables[$param['num']]['height'])-1];
            } else {
                $y = self::$_tables[$param['num']]['curr_y'];
            }

But now I get an error like this. The current sentence takes more than 1000 lines is the current box

$html2pdf->setSentenceMaxLines(700000);

Even this did not solve my mistake. It took a long time.

1YalcinSahin1 avatar Jul 27 '20 08:07 1YalcinSahin1

normally it has been resolved in the last version of html2pdf

which version do you use ?

spipu avatar Nov 06 '20 07:11 spipu