mPDF Manual – Troubleshooting

# Blank screen

If you get nothing but a blank screen on your browser, it may be because there is a script error. Turn on debugging at the start of your script:

<?php

try {
$mpdf = new \Mpdf\Mpdf();$mpdf->debug = true;
$mpdf->WriteHTML("Hello World");$mpdf->Output();
} catch (\Mpdf\MpdfException $e) { // Note: safer fully qualified exception // name used for catch // Process the exception, log, print etc. echo$e->getMessage();
}



To generate images and retrieve external stylesheets, mPDF needs to access files using fopen() etc. Changing localhost to 127.0.0.1 resolved the problem.
JPGraph outputs error messages as images generated by the script. If the error message is “out of memory” then you just get a blank screen. Try increasing your memory_limit.