By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,949 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,949 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

Expert Mod 10K+
P: 12,408
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>
In above css code as we are using media="print" this will execute when we print the page only.
Dec 26 '11 #3

Expert Mod 10K+
P: 12,408
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.