How to open links in new tab/window which is in pdf document. I tried target="_blank"
but it did not work. I was found javascript
solution on the internet. But how I can use javascript
in tcpdf.
I tried the following:
$text = 'bla bla bla bla bla bla bla bla<br>';
$url = "http://google.com";
$links = ' <a href="javascript:open_win('.$url.');">Click me</a>
<a href="'.$url.'" target="_blank">Click me</a> ';
$output = $text.$links; $pdf->writeHTML($output);
But it did not work.
use the below method
<a href="javascript: w=window.open('yoursite.com/LinkToThePDF.pdf'); w.print(); w.close(); ">print pdf</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With