Reputation: 17
$pdf = new TCPDF();
$myHTML = '<a href="https://www.google.com/">TEST LINK</a>';
$pdf->writeHTML($myHTML, true, false, true, false, '');
This is the screenshot of output in PDF from the code above but not clickable
Upvotes: 0
Views: 1703
Reputation: 506
For me worked to use escaped double quotes
$html = "<a href=\"http://your.link.com\">Link</a>";
Upvotes: 0
Reputation: 39
Rather old post but if you come across this:
Upvotes: 1
Reputation: 430
I've struggled with this one too for a while. For me it worked to change single quotes around the link to double quotes. It's the same with using the write method on a newline character.
If I were to write:
$pdf->Write(4, '\n');
then I'd see the newline characters printed on the PDF in stead of a return
When I write:
$pdf->Write(4, "\n");
then the newline gets created.
So, do you have the same behaviour with the double/single quotes. And just for the sake of it, try changing them anyhow and/or remove the final slash from the link.
Alternatively, you can try to change your code to:
$pdf->Write(4, 'TEST LINK', 'https://www.google.com');
Upvotes: 0