【问题标题】:Can I send a pdf file to the printer automatically? [duplicate]我可以自动将 pdf 文件发送到打印机吗? [复制]
【发布时间】:2011-05-26 21:03:37
【问题描述】:

我有以下几点:

<iframe src="ACRBusinessCL.pdf" id="PDFtoPrint" height="800" width="800">
</iframe>
<form>
<input type="button" value="Print" onclick="document.getElementById('PDFtoPrint').focus(); document.getElementById('PDFtoPrint').contentWindow.print();">
</form>

让我发疯的原因是:我以为我在某一时刻完成了这项工作。 pdf 文件显示在 iframe 中,但是当我单击打印时,没有任何反应。

【问题讨论】:

  • 也许这会有所帮助:stackoverflow.com/questions/472951/…>

标签: javascript


【解决方案1】:
<script type="text/javascript">
    function printPage(yoururl) {
            var w = window.open(yoururl);
            w.document.write(yoururl);
            w.print();
    }

</script>

【讨论】:

  • 这个答案很差。为您的答案添加解释。
  • 网址正在打印
猜你喜欢
  • 2013-07-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-25
相关资源
最近更新 更多