如何打印PDF文件 [英] How to print pdf file
本文介绍了如何打印PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的网页上,我有标题部分和Iframe部分.在Iframe中,我正在打开PDF文件.
在标题上,我要单击要打印iframe中PDF文件内容的打印按钮.那么该怎么做呢?
我在Google上尝试过,但没有任何有效的解决方案.
on my webpage i have header section and Iframe section.In Iframe i am opening PDF file.
On Header i have print button on click of that i want to print PDF file contents which is in iframe. So how to to do that?
I tried on google but i not got any effective solution.
<embed src="vehinvc.pdf" id = "Pdf1" name="Pdf1" hidden>
<a önClick="document.getElementById(''Pdf1'').printWithDialog()">
和
and
<OBJECT id = "Pdf2" name="Pdf2" CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="364" HEIGHT="290">
<PARAM NAME=''SRC'' VALUE="file.pdf">
</OBJECT>
<a önClick="document.Pdf2.printWithDialog()">Print file</a>
它不起作用.
如果有人知道,那么请帮助.
谢谢.
It is not working.
If anybody know then plz help..
Thanks.
推荐答案
我不确定是否可以,因为Adobe最终会在浏览器中打开PDF,因此您不能使用javascript调用print( ),就像访问网页一样.
您是否尝试在javascript中调用print()?我怀疑它是否可以工作,但是如果不能,则不能这样做.
I am not sure that you can, because Adobe ends up opening the PDF inside your browser, so you can''t use javascript to call print() like you can for a web page.
Have you tried calling print() in javascript ? I doubt it will work, but if it does not, you can''t do it.
阅读以下内容:
http://www.htmlgoodies.com/beyond/javascript/article.php/3471121/Print-a-Web-Page-Using-JavaScript.htm [ http://www.tizag.com/javascriptT/javascriptprint.php [ http://stackoverflow.com/questions/975652/silent-print-a-embedded-pdf [^ ]
Read the following :
http://www.htmlgoodies.com/beyond/javascript/article.php/3471121/Print-a-Web-Page-Using-JavaScript.htm[^]
http://www.tizag.com/javascriptT/javascriptprint.php[^]
http://stackoverflow.com/questions/975652/silent-print-a-embedded-pdf[^]
这篇关于如何打印PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文