mPDF Manual – mPDF Variables

allow_output_buffering

(mPDF ≥ 3.0)

Description

boolean allow_output_buffering

When true, mPDF will ignore any content in the object buffer - ob_get_contents() - when outputting the PDF file. By default, any buffered output will be treated as an error message and will abort the PDF file output and display any errors to the browser.

Values

$allow_output_buffering = false|true

Values

  • false: Any buffered output from the script will trigger an error message and abort production of the PDF file.
  • true: Ignores any content in the object buffer when outputting the PDF file.

Default: false

Usage

Set at beginning of document

<?php
$mpdf = new \Mpdf\Mpdf([
    'debug' => true,
    'allow_output_buffering' => true
]);

See Also

Fork me on GitHub