mPDF Manual – mPDF functions

RestartDocTemplate()

(mPDF >= 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

Version Description
2.4 Function was added.

Examples

Example #1

<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\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

Fork me on GitHub