debug
(mPDF ≥ 3.1)
Note: This variable was partially succeeded by usage of \Psr\Log\LogInterface
in 7.0
debug – increase severity of error messages - throw a \Mpdf\MpdfException
where an error is possible
Description
void debug
Specify whether to show debugging messages. If you are having problems with mPDF, set
$debug to true
to throw a \Mpdf\MpdfException
where an error that may otherwise be suppressed is possible.
Values
$debug = true
|false
Values
true
: enable debuggingfalse
: disable debugging
Default: false
Changelog
Version | Description |
---|---|
3.1 | Variable was added. |
Examples
Example #1
<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf(['debug' => true]);
$mpdf->WriteHTML("Hello World");
$mpdf->Output();
Note: This was introduced in mPDF 3.1 as the method used by mPDF to catch error messages
inadvertently picked up suppressed errors such as those caused by @fopen()
- even though the @ is deliberately
there to prevent interruption of the script.
See Also
- Logging
- showImageErrors - show/hide error reporting for problems with Images
- allow_output_buffering - prevent error mesages when using output buffering