简体   繁体   English

在新的浏览器窗口中打开的.pdf文件会立即显示打印设置,该如何解决?

[英]Opened .pdf in new browser window immediately shows print settings, how to fix this?

I have made a website and have an annoying problem. 我已经建立了一个网站,并且遇到了一个烦人的问题。

If a visitor clicks on a link to a .pdf file, it opens in a new window as I specified in the code with target="_blank". 如果访问者单击指向.pdf文件的链接,则它将在新窗口中打开,如我在代码中使用target =“ _ blank”指定的那样。 When the .pdf opens, the print settings immediatly pop up, as if the user clicked on the 'print' button in his browser .pdf viewer. 当.pdf打开时,将立即弹出打印设置,就像用户在其浏览器.pdf查看器中单击“打印”按钮一样。

How do I solve this? 我该如何解决? The print settings must not popup immediately. 打印设置不得立即弹出。 I don't think it is specified in my code, nor do I think it is a browser setting, because it only happens on my own website and not on other sites. 我不认为它是在我的代码中指定的,也不是浏览器设置,因为它仅在我自己的网站上发生,而不在其他网站上发生。

<h2>PDF File</h2>
<?php 
if ($row_Recordset['file'] != NULL) 
{ ?>
<a class="file_link" href="../files/<?php echo $row_Recordset['file']; ?>" target="_blank"><img src="../img/pdf.gif" width="40" height="40" alt="PDF File" />PDF File </a>
<?php 
}
else
{
     echo "<p>No file.</p>";
}
?>

The css contains the following: CSS包含以下内容:

.file_link { color: black; }

This might be because your PDF files have an "open action" that invokes this dialog when the file is opened. 这可能是因为您的PDF文件具有“打开操作”,当打开文件时会调用此对话框。 Check this question and its answers for details: Generate a pdf that automatically prints 查看此问题及其答案以获取详细信息: 生成自动打印的pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM