kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

'break' not in the 'loop' or 'switch' context #30

Closed joggeli closed 8 years ago

joggeli commented 8 years ago

PHP Version 7.0.4

There is an error in \vendor\kartik-v\mpdf\classes\svg.php on line 2710 when generating a PDF with SVG files in it.

'break' not in the 'loop' or 'switch' context.

Replacing the "break" with "return" seems to work as a temporary fix.

joggeli commented 8 years ago

It looks like this plugin uses an outdated version of mpdf, which is not compatible with PHP 7.

fmp-martins commented 8 years ago

I have the same issue, but if I try the workaround of replacing the "break" with "return", my PDF gets a lot of garbage in the end.

This component needs to be updated because I'm also getting some Acrobat Reader (on latest version) warning about loading fonts and it no longer shows latin chars. It works fine with other readers though.

kartik-v commented 8 years ago

This extension has been changed some time back to use mpdf1/mpdf repo...