By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

Print page

P: 1
how can i disable the print preview of page during printing
Dec 23 '11 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,347
In a web browser? You can't. Or rather, the only way to do it would be through client-side scripting and that can be disabled so that the code doesn't run. But why would you even need to disable print preview?
Dec 23 '11 #2

P: 5
By using CSS you can able to achieve in print preview blank page.
Expand|Select|Wrap|Line Numbers
  1. <style type="text/css" media="print">
  2. body 
  3. { display: none;} 
  4. </style>
  5.  
In above css code as we are using media="print" this will execute when we print the page only.
Dec 26 '11 #3

Rabbit
Expert Mod 10K+
P: 12,347
Just be aware that not all versions of web browsers will support that.
Dec 26 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.