简体   繁体   中英

Print a pdf file at client side

我想在不使用Adobe Pdf查看器的打印按钮的情况下向Pdf文件发出打印命令,而不是在Pdf查看器中使用打印按钮,我想使用单独的事件来做到这一点吗?

HTML

<input type="submit"  value="Print" name="Submit" id="printbtn" onclick="printPDF('D:/asb.Pdf')" />

Javascript

function printPDF(htmlPage)
{ 
var w = window.open("about:blank");
w.document.write(htmlPage);
if (navigator.appName == 'Microsoft Internet Explorer') window.print();
else w.print();
}

Yes It's Possible. But You cannot do this with javascript or JQuery. you need to have javascript library to do this. Please check out this links.

Hope This Will Helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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