mPDF Manual – mPDF Variables

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

$autoPageBreakTRUE FALSE

Values

TRUE : enables automatic page breaks

FALSE: disable automatic page breaks

DEFAULT: TRUE

Changelog

VersionDescription
3.1 Variable was added.

Examples

Example #1

<?php

// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new mPDF();

$html = '<img src="largeimage.jpg" height="290mm" /> ';

$mpdf->autoPageBreak = false;

$mpdf->AddPage();

$mpdf->WriteHTML($html);

$mpdf->Output();

?>