开发者

How to disable printing options in the browser for certain pages

Env: jQuery, richfaces, all major browsers

How to disable printing options in开发者_StackOverflow社区 the browser for certain pages (e.g. File-->Print Preview, Print)


You cannot disable the actual buttons/menu items but you can use following in required pages to prevent printing:

<style type="text/css" media="print">
BODY {display:none;visibility:hidden;}
</style>


You can not disable the browser print buttons, however you can use print @media CSS to hide certain parts or whole page completely from printing. For example, you can use CSS such as this:

@media print {
  html, body {
    display: none;  /* hide whole page */
  }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜