mPDF Manual – mPDF Variables

debug

(mPDF ≥ 3.1)

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

$debugtrue|false

Values

  • true: enable debugging
  • false: 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();

See Also

Fork me on GitHub