<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PdfViewer.aspx.cs" Inherits="PdfViewer" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" />
        <script type="text/javascript">
            window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';

            // Disable the context menu
            document.addEventListener('contextmenu', function (event) {
                event.preventDefault();
                // Optionally, you can inform the user that the right-click functionality is disabled.
                alert('Right-click context menu is disabled on this page.');
            }, false);

            //disable shortcuts
            document.addEventListener('keydown', function (event) {
                if ((event.ctrlKey || event.metaKey) && (event.key === 's' || event.key === 'p' || event.key === 'c')) {
                    event.preventDefault();
                    // Optionally, you can alert the user that this action is disabled.
                    alert('Saving, printing, and copying are disabled on this page.');
                }
            }, false);

        </script>
        <telerik:RadPdfViewer ID="RadPdfViewer1" runat="server" Width="100%" Height="1000px">
            <ToolBarSettings Items="pager, spacer, zoom, toggleSelection, spacer, search, open" />
        </telerik:RadPdfViewer>


    </form>
</body>
</html>
