php - Is there a way to disable copy function in embedded pdf html
问题描述
So I'm making a pdf page and I'm trying to make it so you can't copy the text inside the pdf.
Here's my code:
<?php
$type = isset($_GET['type']) ? $_GET['type'] : '';
$code = isset($_GET['code']) ? $_GET['code'] : '';
?>
<!DOCTYPE html>
<html>
<head>
<link rel="icon" href="../assets/images/icon/pup-icon.png" type="image/x-icon" />
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/icon/pup-icon.png" />
<style type="text/css"></style>
<title>Polytechnic University of the Philippines</title>
</head>
<body>
<embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="../thesis/<?php echo $type; ?>/<?php echo $code; ?>.pdf" type="application/pdf">
</body>
</html>
I also tried to put onmousedown="return false" onselectstart="return false" on the body but it doesn't seem to do anything.
解决方案
推荐阅读
- c# - 当前上下文中不存在名称“item”
- ansible - 基本的 ansible 命令行因模块故障错误而失败
- docker - 无法为高可用性存储创建文件系统
- python - SQLAlchemy:从外键推断的列类型
- java - 为什么 VM 线程会减慢我的 Web 应用程序的速度?
- java - 如何在 selenium java 中处理工具提示
- vue.js - 如何将带有 Jest 的 Vue Test Utils 添加到现有的 Vue-CLI 3 项目中?
- javascript - 如何让用户截取页面?
- android - 如何通过发送 URL 从我们的活动中打开受信任的网络活动
- integer - 在我输入数字时更改数组的长度。(IBM ILOG CPLEX OPL)