mPDF Manual – mPDF Variables

bookmarkStyles

mPDF >= 5.4

Bookmarks can be styled by adding code as below to your script. You can define a colour (array of RGB) and/or a font-style (B, I, or BI) for each level (starting at 0). Results may depend on the PDF Reader you are using.

Example

Example #1 - In config.php file
<?php

$this->bookmarkStyles = array(

0 => array('color'=> array(0,64,128), 'style'=>'B'),

1 => array('color'=> array(128,0,0), 'style'=>''),

2 => array('color'=> array(0,128,0), 'style'=>'I'),

);

?>