(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 afont-style ('B','I', or'BI') for each level (starting at0). Results may depend on the PDF Reader you are using.
Set as aconfiguration variable
<?php$config=['bookmarkStyles'=[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'),]];$mpdf=new\Mpdf\Mpdf($config);