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(); // only with mPDF <8.0
// 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
- SetImportUse() - Enable the use of imported PDF files or templates
- SetDocTemplate() - Specify an external PDF file to use as a template
- Thumbnail() - Print thumbnails of an external PDF file
- SetSourceFile() - Specify the source PDF file used to import pages into the document
- UseTemplate() - Insert an imported page from an external PDF file
- SetPageTemplate() - Specify a page from an external PDF file to use as a template