Image in MPDF footer won't work as a link
-
19-04-2021 - |
Question
I'm adding the following to my MPDF footer:
<a href="#bottom"><img src="arrowdownred.jpg" width="40" height = "34" />↓</a>
It's showing up fine, and the ↓ character works fine as a link, but the image doesn't!
The cursor changes when I mouse over it, but it doesn't work when clicked.
Anyone got any ideas?
La solution
So I found the answer deep in the MPDF forum, so I thought I'd post it up here: It's a bug with image links to fix it, in mpdf.php, line 18330, find:
if ($this->HREF) { $objattr['link'] = $this->HREF; } // ? this isn't used
and replace with:
if ($this->HREF) {
if (strpos($this->HREF,".") === false && strpos($this->HREF,"@") !== 0) {
$href = $this->HREF;
while(array_key_exists($href,$this->internallink)) $href="#".$href;
$this->internallink[$href] = $this->AddLink();
$objattr['link'] = $this->internallink[$href];
}
else { $objattr['link'] = $this->HREF; }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow