I am using mPDF and it is working fine with localhost. I upload the project to live server and it is not generating pdf correctly.
<?php
// HTML ommited
$body = ob_get_clean();
include ("mpdf/mpdf.php");
$mpdf = new mPDF('+aCJK', 'A4', '', '', 0, 0, 0, 0, 0, 0);
$mpdf->WriteHTML($body);
$mpdf->Output('SaveToPDF.pdf', 'D');
On the top, I put the error show code. To see the error what is going wrong I have the following error.
Fatal error: Switch statements may only contain one default clause in /customers/d/e/a/....URL..GO..HERE/mpdf.php on line 1432
I am using PHP Version 5.6.31 on my Localhost and on live I am using one.com and there I can switch to different PHP versions, and I tried all. i.e. 5.6, 7.0, 7.1, 7.2 beta
I am using mPDF 5.7 and it is not composer version. I wanted to use chines character for my pdf and it good support available in 5.7. That's why I chose older version
Old mpdf
versions don't support PHP7, unfortunately (mpdf issue). You can either:
mpdf
source yourself (people discussed the possible solution in this hhvm issue), you just need to remove one of the default
statements.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With