showWatermarkText
(mPDF ≥ 2.2)
Description
boolean showWatermarkText
Specifies whether or not to show/print the watermark text on each page. The text for the watermark must be defined using SetWatermarkText(). The watermark is added to the document at the end of each page.
Note: This superseded TopicIsUnvalidated in mPDF 2.2 as an alias, and is now the preferred form.
Values
$showWatermarkText = true
|false
If $showWatermarkText is true
or 1
the watermark text
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 textfalse
: Do not show/print the watermark text
Default: false
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();
$mpdf->SetWatermarkText('DRAFT');
$mpdf->showWatermarkText = true;
$mpdf->WriteHTML('Hello 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->showWatermarkText = false;
$mpdf->WriteHTML('Hello World');
See Also
- SetWatermarkText() - Set the text to use as a Watermark
- SetWatermarkImage() - Set an image to use as a Watermark
- watermarkImageAlpha - Specifies the transparency (alpha value) for the watermark image
- watermarkTextAlpha - Specifies the transparency (alpha value) for the watermark text
- showWatermarkImage - Specifies whether or not to show/print the watermark image
- watermark_font - Specifies the font to use for Watermark text