<%-- 
    Document   : HRmanual
    Created on : May 11, 2024, 7:56:28 PM
    Author     : dipti
--%>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Secure Document</title>
    <script>
        // Disable right-click context menu
        document.addEventListener('contextmenu', event => event.preventDefault());

        // Disable keyboard shortcuts for printing
        document.onkeydown = function (e) {
            if (e.ctrlKey && (e.keyCode === 80 || e.keyCode === 85 || e.keyCode === 67 || e.keyCode === 83)) {
                e.preventDefault();
            }
        };

        document.onkeyup = function (e) {
            if (event.keyCode === 44) {
                e.preventDefault();
            }
        };

        // Disable text selection
        document.onselectstart = function (e) {
            e.preventDefault();
        };

        // Disable dragging of images
        document.ondragstart = function (e) {
            e.preventDefault();
        };

        document.addEventListener('keydown', function (event) {
            if (event.ctrlKey && (event.keyCode === 80 || event.keyCode === 85 || event.keyCode === 67 || event.keyCode === 83)) {
                event.preventDefault();
                alert("Printing is not allowed.");
                if (event.keyCode === 44) { // Print Screen key
                alert("Screenshots are not allowed.");
            }
            }          
        });
        

        
        
    </script>
</head>
<body>
    <h1>Secure Document</h1>
    <p>This document is protected.</p>
</body>


    

</html>

