mPDF Manual – mPDF Variables

showStats

(mPDF >= 4.0)

showStats – Display performance data for the generated PDF file

Value

void showStats

Specify whether to show performance data. Useful if you are developing with mPDF, and want to test different configurations.

Values

$showStatstrue|false

Values

  • true: enable display of data
  • false: disabled

Default: false

Changelog

Version Description
4.0 Variable was added.

Examples

Example #1

<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();

$mpdf->showStats = true;

$mpdf->WriteHTML("Hello World");
$mpdf->Output();

This will suppress output of the PDF file, and display data on the browser such as:

Generated in 0.45 seconds

Compiled in 0.46 seconds (total)

Peak Memory usage 10.25MB

PDF file size 37kB

Number of fonts 6

See Also

Fork me on GitHub