mPDF Manual – mPDF functions

SetVisibility()

(mPDF >= 5.4)

SetVisibility – Set the visibility of subsequent objects

Description

void SetVisibility ( string $visibility )

Set the visibility of subsequent objects

Parameters

$visibility

This parameter specifies the visibility.

Values

STRING - One of the following:

  • 'visible'
  • 'hidden'
  • 'printonly'
  • 'screenonly'

Default: 'visible'

Changelog

Version Description
5.4 Function was added.

Examples

Example #1

<?php

$mpdf->SetVisibility('printonly');
$mpdf->WriteHTML('This text will only be visible when the document is printed');

$mpdf->SetVisibility('screenonly');
$mpdf->WriteHTML('This text will only be visible on screen, and will not 
be included when the document is printed');

...

See Also

Fork me on GitHub