Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php PDF链接应在mPDF库的新选项卡中打开_Php_Html_Drupal 7_Mpdf - Fatal编程技术网

Php PDF链接应在mPDF库的新选项卡中打开

Php PDF链接应在mPDF库的新选项卡中打开,php,html,drupal-7,mpdf,Php,Html,Drupal 7,Mpdf,我想在新选项卡中打开嵌入在pdf中的链接。我正在使用Drupal中的mPDF库生成pdf。我尝试了target=“\u blank”,但它不起作用。这就是我实际使用的代码 <tr><td><a target="_blank" style="color: #fff; text-decoration: none;" href="'.$course_url.'">' . $coursecertfiltered . '</a></td><

我想在新选项卡中打开嵌入在pdf中的链接。我正在使用Drupal中的mPDF库生成pdf。
我尝试了target=“\u blank”,但它不起作用。这就是我实际使用的代码

<tr><td><a target="_blank" style="color: #fff;  text-decoration: none;" href="'.$course_url.'">' . $coursecertfiltered . '</a></td></tr>

如果对Javascript有信心,您可以尝试:

<a onclick="openInNewTab('path-to-pdf-file');">Open in a new Tab</a>

<script>
  function openInNewTab(url) {
    var win = window.open(url, '_blank');
    win.focus();
  }
</script>
在新选项卡中打开
函数openInNewTab(url){
var win=window.open(url,“_blank”);
win.focus();
}

您使用的确切代码是什么请查找有问题的代码,刚才我编辑了我认为PDF不支持指定目标。请在标记的和处指定target=“\u blank”。。这可能适用于动态pdf。这样地: