静默打印PDF文件 [英] Print PDF file silently

查看:916
本文介绍了静默打印PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guys





我想用特定的打印机静默打印pdf文件而不使用adobe reader exe。我怎样才能实现这个目标。



请帮助我紧急。

Hello Guys


I want to print pdf file silently with specific printer without using adobe reader exe. how can i achieve this.

Please help me its urgent.

推荐答案

使用IFRAME并分配生成的PDF格式。



< iframe id =printfname =printfsrc =http:// localhost:4685 / PrintImages / 44。 PDF>< / iframe>



然后写一个函数来打印pdf。

Use the IFRAME and assign your Generated PDF to That.

<iframe id="printf" name="printf" src="http://localhost:4685/PrintImages/44.PDF"></iframe>

then write a function to print pdf.
<script>
function printIframe()
{
    if (navigator.userAgent.indexOf("Firefox")!=-1){
        var iframe_window = window.frames["my_iframe"];
        window.frames["my_iframe"].document.write('<body></body>');
        iframe_window.print();
    }
    else if(navigator.userAgent.indexOf("MSIE")!=-1){
        var x = document.getElementById("pdfDocument");
        x.print();
    }
    else if(navigator.userAgent.indexOf("Chrome")!=-1){
        document.my_iframe.focus();
        document.my_iframe.print();
    }
    else{
          
    }

}







添加一个按钮并分配此功能on

< input type =button id =pdfvalue =Printonclick =printIframe();>





希望它可以帮到你。 ............




add a button and assign this function onclick..
<input type="button" id="pdf" value="Print" onclick="printIframe();">


Hope it may help you.............


使用福昕阅读器 [ ^ ]:

Use Foxit Reader[^]:
Process pdfProcess = new Process();
pdfProcess.StartInfo.FileName = "FoxitReaderExePath"; //C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe
pdfProcess.StartInfo.Arguments = string.Format(@"-p {0}", fileNameToSave);
pdfProcess.Start();





希望它有所帮助!

- Amy


Hello Sharma,



这一个可以帮助你....

http://www.codeproject.com/Tips/598424/How-to-Silently-Print-PDFs-using-Adobe-Reader-and
Hello Sharma,

This One May Help you ....
http://www.codeproject.com/Tips/598424/How-to-Silently-Print-PDFs-using-Adobe-Reader-and


这篇关于静默打印PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆