How To Open Links In New Window Which Is In PDF Created By TCPDF
I have tried target='_blank' but nothing happens. Is anybody help for this issue? I need to open links in new tab/window which is in PDF file. I'm using TCPDF 5.9.176
Solution 1:
Try using javascript:
<script type="text/javascript">function abrirVentana(url) {
window.open(url, "nuevo");
}
</script>
and then the HTML:
<a href="#" onClick="abrirVentana('http://')"></a>
Solution 2:
Another way would be this:
<script type="text/javascript">function openExternal(){
if(!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName(’a');
for(var i = 0; i < anchors.length; i++){
var thisAnchor = anchors[i];
if(thisAnchor.getAttribute(’href’) && thisAnchor.getAttribute(’rel’) == ‘external’){
thisAnchor.target = ‘_blank’;
}
}
}
window.onload = openExternal;
</script>
<a href="http://" rel=”external”></a>
Post a Comment for "How To Open Links In New Window Which Is In PDF Created By TCPDF"