开发者

how to print a web page [duplicate]

开发者 https://www.devze.com 2023-03-02 11:36 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: How to print a portion of an HTML page?
This question already has answers here: Closed 10 years ago.

Possible Duplicate:

How to print a portion of an HTML page?

I am making a quotation online. I want the user to be able to print it.

I have seen my exact requirement on this webpage. On this web page, t开发者_开发问答here is a print option. When the user clicks on print it will send a print command to the printer if a printer is attached.

Does anyone know how can I do that?


<button id="printbutton" onclick="window.print();" />


I'm quite confused by your question...

To trigger a print programatically with JavaScript (PHP won't help you much), you can call window.print() :

<input type="button" onclick="window.print()" />
0

精彩评论

暂无评论...
验证码 换一张
取 消