R
R
Radist_1012015-09-19 08:53:24
JavaScript
Radist_101, 2015-09-19 08:53:24

How to send a command to print a document through the browser?

Good day! How to send a command to print a document using javascript in a browser? It is necessary that when you click on the button on the page, the document immediately goes to print.
I found such a comment, it says that everything is simple, but it is not yet clear how to do
habrahabr.ru/post/240775/#comment_8083783

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2015-09-19
@Radist_101

It is necessary that when you click on the button on the page, the document immediately goes to print.
this is a game, and thank the eggs that sane browsers do not allow this.
there is a standard way: window.print();and there the user himself decides what to do. for example, on OSX, instead of printing, you can save the page to pdf.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question