, : , , , , PDF.
.....
1. php ( usb). 2. "Pdf_Files" PDF. 3. pdf.js 4. ...
blocked.js
$(function() //right click disabled
{
$(this).bind('contextmenu',function()
{
alert("Function disabled");
return false;
})
});
function copyToClipboard() {
var aux = document.createElement("input");
aux.setAttribute("value", "Function Disabled.....");
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
alert("Print screen disabled.");
}
function blockPrint() {
alert("Print is not allowed...");
}
function PreSaveAction() {
alert("saving..");
}
$(function()
{
$(this).keyup(function(e){
if(e.keyCode == 44 || e.keyCode == 137 ||e.KeyCode == 93 )
{
copyToClipboard();
return false;
}
})
});
document.onkeydown = function (e) {
e = e || window.event;
if (e.ctrlKey) {
var c = e.which || e.keyCode;
switch (c) {
case 83:
case 80 :
case 17 :
case 16 :
e.preventDefault();
e.stopPropagation();
alert("key disabled");
break;
}
}
};
$(window).focus(function() {
$("body").show();
}).blur(function() {
$("body").show();
});
function setClipBoardData(){
setInterval("window.clipboardData.setData('text','')",20);
}
function blockError(){
window.location.reload(true);
return true;
}
MyIframe.php
<html>
<head>
<title> </title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="blocked.js"></script>
<link rel="stylesheet" type="text/css" href="myStyle.css">
</head>
<body onbeforeprint="copyToClipboard()" >
<?php
$file = './Pdf_Files/';
if( isset($_REQUEST["path"] ) )
$file .= $_REQUEST["path"];
echo ' <iframe src="pdfjs/web/viewer.html?file=../../'. $file .'#toolbar=0&navpanes=0" /> ';
?>
</body>
</html>
myStyle.css
@media print { * { display: none; } }
iframe {
height: 100%;
width:100%;
padding:0;
overflow-x: scroll;
border:none;
overflow-y: scroll;
}
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
input[type="submit"] {
background:none!important;
color:inherit;
border:none;
padding:0!important;
font: inherit;
border-bottom:1px solid #444;
cursor: pointer;
}
test.php
<html>
<head>
<title> </title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="blocked.js"></script>
<link rel="stylesheet" type="text/css" href="myStyle.css">
<body>
<form method="post" action="MyIframe.php" >
<table align="center" width="800px" cellspacing="20px" >
<?php
$path = './Pdf_Files/';
$count = 0;
if( $handler = opendir( $path ) )
{
while( false !== ($file = readdir($handler)))
{
if( strpos($file, '.pdf' ) !== false )
{
if( $count++ % 2 == 0 )
echo '<tr>';
echo '<td> * <input type="submit" name="path" value="'. $file .'" /> </td> ';
}
}
closedir($handler);
}
?>
</table>
</form>
</body>
</html>
, PDF , .
- - Url - "localhost:" port "/test.php"
- PDF "Pdf_Files"
- autometicy fetch .