PDF Thumbnails Examples

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 pdf.js library. Here is the example pdf used for the thumbnails of this page.

Responsive images (no size specified in data-attributes)

col-sm-6

col-sm-3

col-sm-2

col-sm-1


Fixed width OR height images

data-pdf-thumbnail-width="200"

data-pdf-thumbnail-height="200"

data-pdf-thumbnail-width="200" AND data-pdf-thumbnail-height="200"


File not found or invalid pdf (see console for errors)

File not found

Invalid file (not a pdf)