-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathtry_pdf.html
More file actions
35 lines (34 loc) · 1.35 KB
/
Copy pathtry_pdf.html
File metadata and controls
35 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PDF水印去除</title>
</head>
<body>
<h1>PDF水印去除</h1>
<form id="uploadForm" action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="file" accept=".pdf" id="fileInput" style="display: none;">
<label for="fileInput" style="cursor: pointer;">选择PDF文件</label>
</form>
<button onclick="removeWatermark()">去除水印</button>
<p id="message"></p>
<a id="downloadLink" href="#" style="display: none;">下载处理后文件</a>
<script>
function removeWatermark() {
fetch('/remove_watermark', { method: 'GET' })
.then(response => response.json())
.then(data => {
document.getElementById("message").innerText = data.message;
if (data.success) {
document.getElementById("downloadLink").href = '/download';
document.getElementById("downloadLink").style.display = 'block';
}
})
.catch(error => {
document.getElementById("message").innerText = "出现错误:" + error.message;
});
}
</script>
</body>
</html>