';
foreach ($this->_toc as $t) {
if ($t['toc_id'] === '_mpdf_all' || $t['toc_id'] === $toc_id) {
$html .= '
';
}
}
$html .= '
';
$this->mpdf->WriteHTML($html);
if (isset($toc_postHTML) && $toc_postHTML) {
$this->mpdf->WriteHTML($toc_postHTML);
}
$this->mpdf->writingToC = false; // mPDF 5.6.38
$this->mpdf->AddPage($toc_orientation, 'E');
$n_toc = $this->mpdf->page - $tocstart + 1;
if ($toci == 0 && $this->TOCmark) {
$TOC_start = $tocstart;
$TOC_end = $this->mpdf->page;
$TOC_npages = $n_toc;
} else {
$this->m_TOC[$toc_id]['start'] = $tocstart;
$this->m_TOC[$toc_id]['end'] = $this->mpdf->page;
$this->m_TOC[$toc_id]['npages'] = $n_toc;
}
}
$s = '';
$s .= $this->mpdf->PrintBodyBackgrounds();
$s .= $this->mpdf->PrintPageBackgrounds();
$this->mpdf->pages[$this->mpdf->page] = preg_replace('/(___BACKGROUND___PATTERNS' . $this->mpdf->uniqstr . ')/', "\n" . $s . "\n" . '\\1', $this->mpdf->pages[$this->mpdf->page]);
$this->mpdf->pageBackgrounds = [];
//Page footer
$this->mpdf->InFooter = true;
$this->mpdf->Footer();
$this->mpdf->InFooter = false;
// 2nd time through to move pages etc.
$added_toc_pages = 0;
if (count($this->m_TOC)) {
reset($this->m_TOC);
}
for ($toci = 0; $toci < $notocs; $toci++) {
if ($toci == 0 && $this->TOCmark) {
$toc_id = 0;
$toc_page = $this->TOCmark + $added_toc_pages;
$toc_orientation = $this->TOCorientation;
$TOCuseLinking = $this->TOCuseLinking;
$TOCusePaging = $this->TOCusePaging;
$toc_bookmarkText = $this->TOCbookmarkText; // *BOOKMARKS*
$tocstart = $TOC_start;
$tocend = $n = $TOC_end;
$n_toc = $TOC_npages;
} else {
$arr = current($this->m_TOC);
$toc_id = key($this->m_TOC);
$toc_page = $this->m_TOC[$toc_id]['TOCmark'] + $added_toc_pages;
$toc_orientation = $this->m_TOC[$toc_id]['TOCorientation'];
$TOCuseLinking = $this->m_TOC[$toc_id]['TOCuseLinking'];
$TOCusePaging = $this->m_TOC[$toc_id]['TOCusePaging'];
$toc_bookmarkText = Arrays::get($this->m_TOC[$toc_id], 'TOCbookmarkText', null); // *BOOKMARKS*
$tocstart = $this->m_TOC[$toc_id]['start'];
$tocend = $n = $this->m_TOC[$toc_id]['end'];
$n_toc = $this->m_TOC[$toc_id]['npages'];
next($this->m_TOC);
}
// Now pages moved
$added_toc_pages += $n_toc;
$this->mpdf->MovePages($toc_page, $tocstart, $tocend);
$this->mpdf->pgsIns[$toc_page] = $tocend - $tocstart + 1;
/* -- BOOKMARKS -- */
// Insert new Bookmark for Bookmark
if ($toc_bookmarkText) {
$insert = -1;
foreach ($this->mpdf->BMoutlines as $i => $o) {
if ($o['p'] < $toc_page) { // i.e. before point of insertion
$insert = $i;
}
}
$txt = $this->mpdf->purify_utf8_text($toc_bookmarkText);
if ($this->mpdf->text_input_as_HTML) {
$txt = $this->mpdf->all_entities_to_utf8($txt);
}
$newBookmark[0] = ['t' => $txt, 'l' => 0, 'y' => 0, 'p' => $toc_page];
array_splice($this->mpdf->BMoutlines, ($insert + 1), 0, $newBookmark);
}
/* -- END BOOKMARKS -- */
}
// Delete empty page that was inserted earlier
if ($extrapage) {
unset($this->mpdf->pages[count($this->mpdf->pages)]);
$this->mpdf->page--; // Reset page pointer
}
/* Fix the over adjustment of the TOC and Page Substitutions values */
if (isset($tocClassClone)) {
$this->_toc = $tocClassClone->_toc;
$this->mpdf->PageNumSubstitutions = $tocClassClone->mpdf->PageNumSubstitutions;
unset($tocClassClone);
}
}
public function openTagTOC($attr)
{
if (isset($attr['OUTDENT']) && $attr['OUTDENT']) {
$tocoutdent = $attr['OUTDENT'];
} else {
$tocoutdent = '';
} // mPDF 5.6.19
if (isset($attr['RESETPAGENUM']) && $attr['RESETPAGENUM']) {
$resetpagenum = $attr['RESETPAGENUM'];
} else {
$resetpagenum = '';
}
if (isset($attr['PAGENUMSTYLE']) && $attr['PAGENUMSTYLE']) {
$pagenumstyle = $attr['PAGENUMSTYLE'];
} else {
$pagenumstyle = '';
}
if (isset($attr['SUPPRESS']) && $attr['SUPPRESS']) {
$suppress = $attr['SUPPRESS'];
} else {
$suppress = '';
}
if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) {
$toc_orientation = $attr['TOC-ORIENTATION'];
} else {
$toc_orientation = '';
}
if (isset($attr['PAGING']) && (strtoupper($attr['PAGING']) == 'OFF' || $attr['PAGING'] === '0')) {
$paging = false;
} else {
$paging = true;
}
if (isset($attr['LINKS']) && (strtoupper($attr['LINKS']) == 'ON' || $attr['LINKS'] == 1)) {
$links = true;
} else {
$links = false;
}
if (isset($attr['NAME']) && $attr['NAME']) {
$toc_id = strtolower($attr['NAME']);
} else {
$toc_id = 0;
}
$this->TOC('', 0, 0, $resetpagenum, $pagenumstyle, $suppress, $toc_orientation, $paging, $links, $toc_id, $tocoutdent); // mPDF 5.6.19 5.6.31
}
public function openTagTOCPAGEBREAK($attr)
{
if (isset($attr['NAME']) && $attr['NAME']) {
$toc_id = strtolower($attr['NAME']);
} else {
$toc_id = 0;
}
if ($toc_id) {
if (isset($attr['OUTDENT']) && $attr['OUTDENT']) {
$this->m_TOC[$toc_id]['TOCoutdent'] = $attr['OUTDENT'];
} else {
$this->m_TOC[$toc_id]['TOCoutdent'] = '';
} // mPDF 5.6.19
if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) {
$this->m_TOC[$toc_id]['TOCorientation'] = $attr['TOC-ORIENTATION'];
} else {
$this->m_TOC[$toc_id]['TOCorientation'] = '';
}
if (isset($attr['PAGING']) && (strtoupper($attr['PAGING']) == 'OFF' || $attr['PAGING'] === '0')) {
$this->m_TOC[$toc_id]['TOCusePaging'] = false;
} else {
$this->m_TOC[$toc_id]['TOCusePaging'] = true;
}
if (isset($attr['LINKS']) && (strtoupper($attr['LINKS']) == 'ON' || $attr['LINKS'] == 1)) {
$this->m_TOC[$toc_id]['TOCuseLinking'] = true;
} else {
$this->m_TOC[$toc_id]['TOCuseLinking'] = false;
}
$this->m_TOC[$toc_id]['TOC_margin_left'] = $this->m_TOC[$toc_id]['TOC_margin_right'] = $this->m_TOC[$toc_id]['TOC_margin_top'] = $this->m_TOC[$toc_id]['TOC_margin_bottom'] = $this->m_TOC[$toc_id]['TOC_margin_header'] = $this->m_TOC[$toc_id]['TOC_margin_footer'] = '';
if (isset($attr['TOC-MARGIN-RIGHT'])) {
$this->m_TOC[$toc_id]['TOC_margin_right'] = $this->sizeConverter->convert($attr['TOC-MARGIN-RIGHT'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-LEFT'])) {
$this->m_TOC[$toc_id]['TOC_margin_left'] = $this->sizeConverter->convert($attr['TOC-MARGIN-LEFT'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-TOP'])) {
$this->m_TOC[$toc_id]['TOC_margin_top'] = $this->sizeConverter->convert($attr['TOC-MARGIN-TOP'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-BOTTOM'])) {
$this->m_TOC[$toc_id]['TOC_margin_bottom'] = $this->sizeConverter->convert($attr['TOC-MARGIN-BOTTOM'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-HEADER'])) {
$this->m_TOC[$toc_id]['TOC_margin_header'] = $this->sizeConverter->convert($attr['TOC-MARGIN-HEADER'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-FOOTER'])) {
$this->m_TOC[$toc_id]['TOC_margin_footer'] = $this->sizeConverter->convert($attr['TOC-MARGIN-FOOTER'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
$this->m_TOC[$toc_id]['TOC_odd_header_name'] = $this->m_TOC[$toc_id]['TOC_even_header_name'] = $this->m_TOC[$toc_id]['TOC_odd_footer_name'] = $this->m_TOC[$toc_id]['TOC_even_footer_name'] = '';
if (isset($attr['TOC-ODD-HEADER-NAME']) && $attr['TOC-ODD-HEADER-NAME']) {
$this->m_TOC[$toc_id]['TOC_odd_header_name'] = $attr['TOC-ODD-HEADER-NAME'];
}
if (isset($attr['TOC-EVEN-HEADER-NAME']) && $attr['TOC-EVEN-HEADER-NAME']) {
$this->m_TOC[$toc_id]['TOC_even_header_name'] = $attr['TOC-EVEN-HEADER-NAME'];
}
if (isset($attr['TOC-ODD-FOOTER-NAME']) && $attr['TOC-ODD-FOOTER-NAME']) {
$this->m_TOC[$toc_id]['TOC_odd_footer_name'] = $attr['TOC-ODD-FOOTER-NAME'];
}
if (isset($attr['TOC-EVEN-FOOTER-NAME']) && $attr['TOC-EVEN-FOOTER-NAME']) {
$this->m_TOC[$toc_id]['TOC_even_footer_name'] = $attr['TOC-EVEN-FOOTER-NAME'];
}
$this->m_TOC[$toc_id]['TOC_odd_header_value'] = $this->m_TOC[$toc_id]['TOC_even_header_value'] = $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = $this->m_TOC[$toc_id]['TOC_even_footer_value'] = 0;
if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'ON')) {
$this->m_TOC[$toc_id]['TOC_odd_header_value'] = 1;
} elseif (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'OFF')) {
$this->m_TOC[$toc_id]['TOC_odd_header_value'] = -1;
}
if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'ON')) {
$this->m_TOC[$toc_id]['TOC_even_header_value'] = 1;
} elseif (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'OFF')) {
$this->m_TOC[$toc_id]['TOC_even_header_value'] = -1;
}
if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'ON')) {
$this->m_TOC[$toc_id]['TOC_odd_footer_value'] = 1;
} elseif (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'OFF')) {
$this->m_TOC[$toc_id]['TOC_odd_footer_value'] = -1;
}
if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'ON')) {
$this->m_TOC[$toc_id]['TOC_even_footer_value'] = 1;
} elseif (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'OFF')) {
$this->m_TOC[$toc_id]['TOC_even_footer_value'] = -1;
}
if (isset($attr['TOC-RESETPAGENUM']) && $attr['TOC-RESETPAGENUM']) {
$this->m_TOC[$toc_id]['TOC_resetpagenum'] = $attr['TOC-RESETPAGENUM'];
} else {
$this->m_TOC[$toc_id]['TOC_resetpagenum'] = '';
} // mPDF 6
if (isset($attr['TOC-PAGENUMSTYLE']) && $attr['TOC-PAGENUMSTYLE']) {
$this->m_TOC[$toc_id]['TOC_pagenumstyle'] = $attr['TOC-PAGENUMSTYLE'];
} else {
$this->m_TOC[$toc_id]['TOC_pagenumstyle'] = '';
} // mPDF 6
if (isset($attr['TOC-SUPPRESS']) && ($attr['TOC-SUPPRESS'] || $attr['TOC-SUPPRESS'] === '0')) {
$this->m_TOC[$toc_id]['TOC_suppress'] = $attr['TOC-SUPPRESS'];
} else {
$this->m_TOC[$toc_id]['TOC_suppress'] = '';
} // mPDF 6
if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) {
$this->m_TOC[$toc_id]['TOC_page_selector'] = $attr['TOC-PAGE-SELECTOR'];
} else {
$this->m_TOC[$toc_id]['TOC_page_selector'] = '';
}
if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) {
$this->m_TOC[$toc_id]['TOCsheetsize'] = $attr['TOC-SHEET-SIZE'];
} else {
$this->m_TOC[$toc_id]['TOCsheetsize'] = '';
}
if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) {
$this->m_TOC[$toc_id]['TOCpreHTML'] = htmlspecialchars_decode($attr['TOC-PREHTML'], ENT_QUOTES);
}
if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) {
$this->m_TOC[$toc_id]['TOCpostHTML'] = htmlspecialchars_decode($attr['TOC-POSTHTML'], ENT_QUOTES);
}
if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) {
$this->m_TOC[$toc_id]['TOCbookmarkText'] = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'], ENT_QUOTES);
} // *BOOKMARKS*
} else {
if (isset($attr['OUTDENT']) && $attr['OUTDENT']) {
$this->TOCoutdent = $attr['OUTDENT'];
} else {
$this->TOCoutdent = '';
} // mPDF 5.6.19
if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) {
$this->TOCorientation = $attr['TOC-ORIENTATION'];
} else {
$this->TOCorientation = '';
}
if (isset($attr['PAGING']) && (strtoupper($attr['PAGING']) == 'OFF' || $attr['PAGING'] === '0')) {
$this->TOCusePaging = false;
} else {
$this->TOCusePaging = true;
}
if (isset($attr['LINKS']) && (strtoupper($attr['LINKS']) == 'ON' || $attr['LINKS'] == 1)) {
$this->TOCuseLinking = true;
} else {
$this->TOCuseLinking = false;
}
$this->TOC_margin_left = $this->TOC_margin_right = $this->TOC_margin_top = $this->TOC_margin_bottom = $this->TOC_margin_header = $this->TOC_margin_footer = '';
if (isset($attr['TOC-MARGIN-RIGHT'])) {
$this->TOC_margin_right = $this->sizeConverter->convert($attr['TOC-MARGIN-RIGHT'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-LEFT'])) {
$this->TOC_margin_left = $this->sizeConverter->convert($attr['TOC-MARGIN-LEFT'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-TOP'])) {
$this->TOC_margin_top = $this->sizeConverter->convert($attr['TOC-MARGIN-TOP'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-BOTTOM'])) {
$this->TOC_margin_bottom = $this->sizeConverter->convert($attr['TOC-MARGIN-BOTTOM'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-HEADER'])) {
$this->TOC_margin_header = $this->sizeConverter->convert($attr['TOC-MARGIN-HEADER'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
if (isset($attr['TOC-MARGIN-FOOTER'])) {
$this->TOC_margin_footer = $this->sizeConverter->convert($attr['TOC-MARGIN-FOOTER'], $this->mpdf->w, $this->mpdf->FontSize, false);
}
$this->TOC_odd_header_name = $this->TOC_even_header_name = $this->TOC_odd_footer_name = $this->TOC_even_footer_name = '';
if (isset($attr['TOC-ODD-HEADER-NAME']) && $attr['TOC-ODD-HEADER-NAME']) {
$this->TOC_odd_header_name = $attr['TOC-ODD-HEADER-NAME'];
}
if (isset($attr['TOC-EVEN-HEADER-NAME']) && $attr['TOC-EVEN-HEADER-NAME']) {
$this->TOC_even_header_name = $attr['TOC-EVEN-HEADER-NAME'];
}
if (isset($attr['TOC-ODD-FOOTER-NAME']) && $attr['TOC-ODD-FOOTER-NAME']) {
$this->TOC_odd_footer_name = $attr['TOC-ODD-FOOTER-NAME'];
}
if (isset($attr['TOC-EVEN-FOOTER-NAME']) && $attr['TOC-EVEN-FOOTER-NAME']) {
$this->TOC_even_footer_name = $attr['TOC-EVEN-FOOTER-NAME'];
}
$this->TOC_odd_header_value = $this->TOC_even_header_value = $this->TOC_odd_footer_value = $this->TOC_even_footer_value = 0;
if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'ON')) {
$this->TOC_odd_header_value = 1;
} elseif (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'OFF')) {
$this->TOC_odd_header_value = -1;
}
if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'ON')) {
$this->TOC_even_header_value = 1;
} elseif (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'OFF')) {
$this->TOC_even_header_value = -1;
}
if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'ON')) {
$this->TOC_odd_footer_value = 1;
} elseif (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'OFF')) {
$this->TOC_odd_footer_value = -1;
}
if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'ON')) {
$this->TOC_even_footer_value = 1;
} elseif (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'OFF')) {
$this->TOC_even_footer_value = -1;
}
if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) {
$this->TOC_page_selector = $attr['TOC-PAGE-SELECTOR'];
} else {
$this->TOC_page_selector = '';
}
if (isset($attr['TOC-RESETPAGENUM']) && $attr['TOC-RESETPAGENUM']) {
$this->TOC_resetpagenum = $attr['TOC-RESETPAGENUM'];
} else {
$this->TOC_resetpagenum = '';
} // mPDF 6
if (isset($attr['TOC-PAGENUMSTYLE']) && $attr['TOC-PAGENUMSTYLE']) {
$this->TOC_pagenumstyle = $attr['TOC-PAGENUMSTYLE'];
} else {
$this->TOC_pagenumstyle = '';
} // mPDF 6
if (isset($attr['TOC-SUPPRESS']) && ($attr['TOC-SUPPRESS'] || $attr['TOC-SUPPRESS'] === '0')) {
$this->TOC_suppress = $attr['TOC-SUPPRESS'];
} else {
$this->TOC_suppress = '';
} // mPDF 6
if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) {
$this->TOCsheetsize = $attr['TOC-SHEET-SIZE'];
} else {
$this->TOCsheetsize = '';
}
if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) {
$this->TOCpreHTML = htmlspecialchars_decode($attr['TOC-PREHTML'], ENT_QUOTES);
}
if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) {
$this->TOCpostHTML = htmlspecialchars_decode($attr['TOC-POSTHTML'], ENT_QUOTES);
}
if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) {
$this->TOCbookmarkText = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'], ENT_QUOTES);
}
}
if ($this->mpdf->y == $this->mpdf->tMargin && (!$this->mpdf->mirrorMargins || ($this->mpdf->mirrorMargins && $this->mpdf->page % 2 == 1))) {
if ($toc_id) {
$this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
} else {
$this->TOCmark = $this->mpdf->page;
}
// Don't add a page
if ($this->mpdf->page == 1 && count($this->mpdf->PageNumSubstitutions) == 0) {
$resetpagenum = '';
$pagenumstyle = '';
$suppress = '';
if (isset($attr['RESETPAGENUM'])) {
$resetpagenum = $attr['RESETPAGENUM'];
}
if (isset($attr['PAGENUMSTYLE'])) {
$pagenumstyle = $attr['PAGENUMSTYLE'];
}
if (isset($attr['SUPPRESS'])) {
$suppress = $attr['SUPPRESS'];
}
if (!$suppress) {
$suppress = 'off';
}
$this->mpdf->PageNumSubstitutions[] = ['from' => 1, 'reset' => $resetpagenum, 'type' => $pagenumstyle, 'suppress' => $suppress];
}
return [true, $toc_id];
}
// No break - continues as PAGEBREAK...
return [false, $toc_id];
}
}