-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
37 lines (34 loc) · 912 Bytes
/
index.html
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
36
37
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>PDF to Image Demo</title>
<style>
html,
body {
font-family: helvetica;
}
</style>
</head>
<body>
<script src="dist/pdf-to-image-dist.js"></script>
<script src="pdfjs/pdf.min.js"></script>
<h2> Select a file</h2>
<h3> Page events will be logged in the console </h3>
<input id="file" type="file" accept="application/pdf"></input>
<br>
<script>
var pdfToImage = new PdfToImage();
document.getElementById("file").addEventListener("change", function() {
fileReader = new FileReader();
fileReader.onload = ev => {
pdfToImage.toImages(fileReader.result);
}
fileReader.readAsArrayBuffer(this.files[0]);
})
pdfToImage.addListener('page', function(result) {
console.log(result);
});
</script>
</body>
</html>