mPDF Manual – mPDF functions

Thumbnail()

(mPDF ≥ 2.3)

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

Description

void Thumbnail ( string $file [, integer $numberperrow [, float $spacing ]])

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

Parameters

$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

Changelog

Version Description
2.3 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

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

$mpdf->Output();

See Also

Fork me on GitHub