Jitendra Vyas
Jitendra Vyas

Reputation: 152855

How to open print-preview page upon clicking on hyperlink?

Every browser has print preview command in their File menu I want to make "print" button on HTML page and upon clicking i want to open print preview page. is this possible?

With this we can open print options <a href="javascript:window.print()">Print this page</a>

but can we open print-preview page instead print options ?

Upvotes: 2

Views: 6236

Answers (2)

Amin Saqi
Amin Saqi

Reputation: 18977

No you can't. However there is a way to show that in IE by using ActiveX and some others for other browsers...

Upvotes: 0

Martin Nycander
Martin Nycander

Reputation: 1309

window.print() is the only print-related function in window.

However, if you have defined a dedicated css-file for print, you can create a page that simulates a print-preview by only using the print stylesheet. And then open this in a popup or new window.

Upvotes: 3

Related Questions