Thursday, March 8, 2012

Disabled print option for SharePoint page

If you want to prevent user from printing SharePoint site page, you can use the below script in CEWB on your SharePoint site.

//Disabled File print and ctrl + P
<style type="text/css" media="print">
body { visibility: hidden; display: none }

The above JavaScript is not totally disabled the CTRL + P or Print option from browser File option. It tells the browser that if this Web page is set to print, switches the body to display nothing. Then, all that will print will be the standard header and/or footer that the browser appends to printed pages.  The user always get printed page with heading and blank page.

No comments:

Post a Comment