简体   繁体   English

如何使用javascript调用系统打印功能

[英]how to call the system print function using javascript

In my asp.net application i just tried to print a webpage using java script, no problem i got it. 在我的asp.net应用程序中,我只是尝试使用Java脚本打印网页,我没问题。 I used the function window .print. 我使用了功能窗口.print。 But the page url also printed,how to remove the url while printing the page.? 但是页面的URL也被打印了,如何在打印页面时删除URL?

The page headers and footers are printed by the browser. 页面页眉和页脚由浏览器打印。 They are not part of your HTML content, so you can't influence them directly in any way (css, jQuery, nothing). 它们不是HTML内容的一部分,因此您不能以任何方式直接影响它们(css,jQuery,什么也没有)。

You can show your users how to disable headers and footers in the "Page setup" printing form or you can generate the result as PDF and serve it, in this way you have full control on the result. 您可以在“页面设置”打印表单中向用户显示如何禁用页眉和页脚,也可以将结果生成为PDF并将其提供,这样您就可以完全控制结果。

If you are talking about the URLs that are displayed on the header and footer of the printout, then that's down to the print setting for each browser. 如果您要谈论的是显示在打印输出的页眉和页脚上的URL,那么这取决于每个浏览器的打印设置。 You cannot remove it with code. 您无法使用代码删除它。 The user has to select it each time according to the browser they're using. 用户每次必须根据使用的浏览器进行选择。

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

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