mPDF Manual – mPDF Variables


(mPDF ≥ 2.2)


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.


$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.


  • true: Show/print the watermark image
  • false: Do not show/print the watermark image

Default: false

Values of 1 or 0 can also be used


Version Description
2.2 The variable was added.


Example #1

$mpdf = new \Mpdf\Mpdf();

$mpdf->showWatermarkImage = true;

Hello World

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

// When the second page is finished the watermark will not appear.
$mpdf->showWatermarkImage = false;

Hello World

See Also

Fork me on GitHub