-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathindex.html
120 lines (112 loc) · 4.38 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
PDF Thumbnails
</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- PDF.js and Simple PDF Thumbnail scripts -->
<script src="pdfThumbnails.js" data-pdfjs-src="pdf.js/build/pdf.js"></script>
<style>
</style>
</head>
<body>
<!-- Page Content -->
<div class="container" id="maincontent">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">PDF Thumbnails
<small>Examples</small>
</h1>
<p>PDF Thumbnails is a small script to parse html files and generate a source image for `img` elements
with a `data-pdf-thumbnail-file` attribute linking to a pdf file.
The image is a preview of the first page of the pdf. The script relies on the <a href="https://github.com/mozilla/pdf.js">pdf.js</a> library.
Here is the <a href="example.pdf">example pdf</a> used for the thumbnails of this page.
</p>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h3>Responsive images (no size specified in data-attributes)</h3>
</div>
<div class="col-sm-6">
<h4>col-sm-6</h4>
<a href="example.pdf">
<img class="img-responsive" data-pdf-thumbnail-file="example.pdf" src="pdf.png">
</a>
</div>
<div class="col-sm-3">
<h4>col-sm-3</h4>
<a href="example.pdf">
<img class="img-responsive" data-pdf-thumbnail-file="example.pdf" src="pdf.png">
</a>
</div>
<div class="col-sm-2">
<h4>col-sm-2</h4>
<a href="example.pdf">
<img class="img-responsive" data-pdf-thumbnail-file="example.pdf" src="pdf.png">
</a>
</div>
<div class="col-sm-1">
<h4>col-sm-1</h4>
<a href="example.pdf">
<img class="img-responsive" data-pdf-thumbnail-file="example.pdf" src="pdf.png">
</a>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h3>Fixed width OR height images</h3>
</div>
<div class="col-sm-4">
<h4>data-pdf-thumbnail-width="200"</h4>
<a href="example.pdf">
<img data-pdf-thumbnail-file="example.pdf" data-pdf-thumbnail-width="200" width="200" src="pdf.png">
</a>
</div>
<div class="col-sm-4">
<h4>data-pdf-thumbnail-height="200"</h4>
<a href="example.pdf">
<img data-pdf-thumbnail-file="example.pdf" data-pdf-thumbnail-height="200" height="200" src="pdf.png">
</a>
</div>
<div class="col-sm-4">
<h4>data-pdf-thumbnail-width="200" AND data-pdf-thumbnail-height="200"</h4>
<a href="example.pdf">
<img data-pdf-thumbnail-file="example.pdf" data-pdf-thumbnail-width="200" data-pdf-thumbnail-height="200" width="200" src="pdf.png">
</a>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h3>File not found or invalid pdf (see console for errors)</h3>
</div>
<div class="col-sm-4">
<h4>File not found</h4>
<a href="notfound.pdf">
<img class="img-responsive" data-pdf-thumbnail-file="notfound.pdf" src="pdf.png">
</a>
</div>
<div class="col-sm-4">
<h4>Invalid file (not a pdf)</h4>
<a href="#">
<img class="img-responsive" data-pdf-thumbnail-file="index.html" src="pdf.png">
</a>
</div>
</div>
<hr>
</div>
<!-- /.container -->
</body>
</html>