1<?php 2 3namespace Mpdf\Tag; 4 5class Bookmark extends Tag 6{ 7 8 public function open($attr, &$ahtml, &$ihtml) 9 { 10 if (isset($attr['CONTENT'])) { 11 $objattr = []; 12 $objattr['CONTENT'] = htmlspecialchars_decode($attr['CONTENT'], ENT_QUOTES); 13 $objattr['type'] = 'bookmark'; 14 if (!empty($attr['LEVEL'])) { 15 $objattr['bklevel'] = $attr['LEVEL']; 16 } else { 17 $objattr['bklevel'] = 0; 18 } 19 $e = "\xbb\xa4\xactype=bookmark,objattr=" . serialize($objattr) . "\xbb\xa4\xac"; 20 if ($this->mpdf->tableLevel) { 21 $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][] = [$e]; 22 } // *TABLES* 23 else { // *TABLES* 24 $this->mpdf->textbuffer[] = [$e]; 25 } // *TABLES* 26 } 27 } 28 29 public function close(&$ahtml, &$ihtml) 30 { 31 } 32} 33