SetImportUse()
(mPDF ≥ 4.3 && < 8.0)
SetImportUse – Enable the use of imported PDF files or templates
Description
void SetImportUse ( )
Enable the use of imported PDF files or templates. This causes additional files (classes) to be loaded, enabling several functions allowing you to import PDF files into the document you are writing, and using templates.
Note: This method was removed in mPDF 8.0, it is no longer needed.
Note: Prior to mPDF 4.3, this required calling mPDFI()
. The functions have now been incorporated
into the main \Mpdf\Mpdf
class, but you must use SetImportUse()
to enable them.
Changelog
Version | Description |
---|---|
4.3 | Function added. |
8.0 | Function removed. |
Examples
<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();
$mpdf->SetImportUse(); // only with mPDF <8.0
$mpdf->WriteHTML('You can use this just like normal, but also import and use templates...');
$mpdf->Output();
See Also
- Thumbnail() - Print thumbnails of an external PDF file
- SetSourceFile() - Specify the source PDF file used to import pages into the document
- ImportPage() - Import a page from an external PDF file
- UseTemplate() - Insert an imported page from an external PDF file
- SetPageTemplate() - Specify a page from an external PDF file to use as a template
- SetDocTemplate() - Specify an external PDF file to use as a template
- RestartDocTemplate() - Re-start the use of a Document template from the next page