autoPageBreak
(mPDF ≥ 3.1)
autoPageBreak – Specify whether to allow automatic page breaks
Description
void autoPageBreak
Specify whether to allow automatic page breaks. By default, mPDF creates page breaks when required in the document.
Setting the value to false
allows an oversized object (image etc.) to overwrite the footer and/or the bottom margin of
the page.
Values
autoPageBreak => true
|false
Values
true
: enables automatic page breaksfalse
: disable automatic page breaks
Default: true
Changelog
Version | Description |
---|---|
3.1 | Variable was added. |
Examples
<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf(['autoPageBreak' => false]);
$html = '<img src="largeimage.jpg" height="290mm" /> ';
$mpdf->autoPageBreak = false;
$mpdf->AddPage();
$mpdf->WriteHTML($html);
$mpdf->Output();
Note: This variable existed in the script before v3.1 but did not allow paging to be turned off. The variable was altered in mPDF 3.1 by making the first letter of the variable lowercase.