mPDF Manual – mPDF functions

RestartDocTemplate()

(mPDFI >= 2.4)

RestartDocTemplate – Re-start the use of a Document template from the next page

Description

void RestartDocTemplate ( )

Restart the use of a document template (set by SetDocTemplate()) from the next page.

Parameters

$none

Changelog

VersionDescription
2.4 Function was added.

Examples

Example #1

<?php

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

$mpdf = new mPDF();

$mpdf->SetImportUse();

// Document template consisting of 2 pages, first with logo and addresses, 2nd with a simple header

$mpdf->SetDocTemplate('logoheader.pdf',true);

$mpdf->AddPage();

$mpdf->WriteHTML($firstletter);

$mpdf->RestartDocTemplate();

$mpdf->AddPage();

$mpdf->WriteHTML($secondletter);

$mpdf->RestartDocTemplate();

$mpdf->AddPage();

$mpdf->WriteHTML($thirdletter);

$mpdf->Output();

?>

See Also