-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
23 lines (22 loc) · 1.3 KB
/
index.html
File metadata and controls
23 lines (22 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html><head>
<!--script src="https://unpkg.com/pdf-lib@1.17.1/dist/pdf-lib.js"></script-->
<script src="https://unpkg.com/pdf-lib@1.17.1/dist/pdf-lib.min.js"></script>
<script src="titleblock.js"></script>
</head><body>
<details id="src" open>
<input id="src_file" type="file" multiple accept="text/csv, application/pdf, image/jpeg, image/png" ondragover="event.preventDefault()" placeholder="Select or drop files here" />
<div id="src_list"></div>
</details>
<iframe id="pdfViewer" src="" type="application/pdf"></iframe>
</body><script>
const callback = result => document.getElementById('pdfViewer').src = URL.createObjectURL(new Blob([result], {type: 'application/pdf'}));
document.getElementById('src_file').onchange = async event => { event.preventDefault(); await titleblcok(event.target.files, callback); }
document.getElementById('src_file').ondrop = async event => { event.preventDefault(); await titleblcok(event.dataTransfer.files, callback); };
</script><style>
html { border: 0; padding: 0; margin: 0; }
body { border: 0; padding: 0; margin: 0; overflow: hidden; width: 100%; height: 100%; }
#src { position: absolute; left: 0; bottom: 0; background-color: #CCC; /*overflow: scroll;*/ }
#src>* { margin: 2px; padding: 2px; }
#pdfViewer { width: 100vw; height: 100vh; }
</style></html>