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

 

Thumbnail()

(mPDF ≥ 2.3)

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

 

 

ParametersPermalink

$file
This parameter specifies the source PDF file to import.

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

$numberperrow
Specifies the number of thumbnails to print in each row.

Default: 3

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

Default: 10

 

 

<?php

// 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);

$mpdf->Output();
See also  PHP 7 Script to Calculate the Script Execution Time on Server in Browser Full Project For Beginners

Leave a Reply