html2pdf icon indicating copy to clipboard operation
html2pdf copied to clipboard

I've Upgraded my PHP to v7.4.16 .. lots of php Errors in html2pdf

Open Mark-Bestwick opened this issue 5 years ago • 5 comments

Deprecated: Array and string offset access syntax with curly braces is deprecated in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\tcpdf.php on line 16893

Deprecated: Array and string offset access syntax with curly braces is deprecated in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\tcpdf.php on line 16893

Deprecated: Array and string offset access syntax with curly braces is deprecated in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\tcpdf.php on line 16896

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\tcpdf.php on line 17778

Deprecated: Array and string offset access syntax with curly braces is deprecated in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\include\tcpdf_images.php on line 318

Warning: chr() expects parameter 1 to be int, string given in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\include\tcpdf_fonts.php on line 1671

Warning: chr() expects parameter 1 to be int, string given in C:\inetpub\wwwroot\tester\vendor\tecnickcom\tcpdf\include\tcpdf_fonts.php on line 1671

Mark-Bestwick avatar Mar 25 '21 14:03 Mark-Bestwick

Same here, I'm using PHP 8.0

jhonnymakis avatar Apr 16 '21 15:04 jhonnymakis

igual para mi, no se como pueda solucionar esto

AR1110 avatar May 05 '21 22:05 AR1110

@Mark-Bestwick The warning is obviously not triggered by spipu/html2pdf but from tecnickcom/tcpdf which is a dependency of this package.

Which version of tecnickcom/tcpdf are you currently using (composer show tecnickcom/tcpdf)?

Version 6.3 should fix the warnings.

W0rma avatar May 24 '21 08:05 W0rma

You can also hack the files: . In simple_html_dom, find all the regex that contain “-“ and escape the character (“-“). Around lines 682 and 1363 . Find the arrays with indexes {1} and replace them by [1] (I remember 2 occurrences (I think in tcpdf main file) . In tcpdf/include/tcpdf_fonts line 1666, add a test that returns “” if $c is empty (static function unichr($c, $unicode=true) {if(empty($c) {return “”;}

you can also activate debugging and it will find the locations for you.

anothersailor avatar Jun 21 '21 06:06 anothersailor

Sorry, simple_html_dom is not part of tcpdf. PS: I have checked TCPDF v6.3 and it does not solve the problems. >> hacking.

anothersailor avatar Jun 21 '21 07:06 anothersailor