mPDF Manual – mPDF Variables

showWatermarkImage

(mPDF >= 2.2)

Description

boolean showWatermarkImage

Specifies whether or not to show/print the watermark image on each page. The file for the watermark must be defined using SetWatermarkImage(). The watermark is added to the document at the end of each page.

Values

$showWatermarkImage = TRUE FALSE

If $showWatermarkImage is TRUE or 1 the watermark image will be added to each page of the document.

The value can be changed during the document to turn the watermark on and off on different pages.

Values

TRUE: Show/print the watermark image

FALSE: DEFAULT Do not show/print the watermark image

Values of 1 or 0 can also be used

Changelog

Version Description
2.2 The variable was added.

Examples

Example #1

<?php

$mpdf = new mPDF();

$mpdf->SetWatermarkImage('images/tiger.jpg');

$mpdf->showWatermarkImage = true;

$mpdf->WriteHTML('
Hallo World
');

// As showWatermark is true when the first page is finished, a watermark is added

$mpdf->AddPage();

// When the second page is finished the watermark will not appear.

$mpdf->showWatermarkImage = false;

$mpdf->WriteHTML('
Hallo World
');

?>

See Also