TCPDF : html content and href link empty

If you get an issue with TCPDF and link inside html content, here is a little patch (apply it in tcpdf.php file) :

// get attributes
// patch
if ($dom[$key][‘value’]==’a’)
{
$element = str_replace(‘\\\”‘, ‘”‘, $element);
}

// en patch
preg_match_all(‘/([^=\s]*)=[“]?([^”]*)[“]?/’, $element, $attr_array, PREG_PATTERN_ORDER);
$dom[$key][‘attribute’] = array(); // reset attribute array
while (list($id, $name) = each($attr_array[1])) {
$dom[$key][‘attribute’][strtolower($name)] = $attr_array[2][$id];
}

Leave a Reply

Your email address will not be published. Required fields are marked *