PHP 7 MPDF Example to Generate Thumbnail Image of External PDF Document in Browser Full Project For Beginners

  • Post author:
  • Post category:PHP
  • Post comments:0 Comments



(mPDF ≥ 2.3)

Thumbnail – Create thumbnails of an external PDF file and insert in current document




This parameter specifies the source PDF file to import.

Note$file should be a relative path to a local file.

Specifies the number of thumbnails to print in each row.

Default: 3

Specifies the spacing (vertical and horizontal) between thumbnails in millimetres.

Default: 10




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

$mpdf = new \Mpdf\Mpdf();
$mpdf->SetImportUse(); // only with mPDF <8.0

$mpdf->Thumbnail('testfile.pdf', 4);

See also  PHP 7 Script to Calculate the Script Execution Time on Server in Browser Full Project For Beginners

Leave a Reply