You'll need some software running on the server to automatically generate thumbnails from a PDF file. You can't do with with HTML and/or JavaScript alone. Most of the examples I've found use ImageMagick, often with GhostScript. They're easy to find in Google.
But, if you're new to web development, I'd suggest creating the thumbnail images manually as best you can and use them as needed.