From ada3181408f5903b33a9f477b015dcb15936fef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20=C4=8Cerman?= Date: Mon, 12 May 2025 13:29:30 +0200 Subject: [PATCH] Automatically add destinations from HTML code --- tcpdf.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcpdf.php b/tcpdf.php index deefe4a2..b5eabd33 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -17427,6 +17427,9 @@ public function writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=fal } } if ($key == $maxel) break; + if ($dom[$key]['tag'] AND $dom[$key]['opening'] AND !empty($dom[$key]['attribute']['id'])) { + $this->setDestination($dom[$key]['attribute']['id']); + } if ($dom[$key]['tag'] AND isset($dom[$key]['attribute']['pagebreak'])) { // check for pagebreak if (($dom[$key]['attribute']['pagebreak'] == 'true') OR ($dom[$key]['attribute']['pagebreak'] == 'left') OR ($dom[$key]['attribute']['pagebreak'] == 'right')) {