More junkdrawer features

I've continued enhancing the static site generator for my junkdrawer (github gist / pastebin replacement). The source code for the static site generator lives right in the same repo.

One thing I missed was some kind of ability to preview PDFs that I have uploaded to the junkdrawer, such as this m6800 reference card that disappeared earlier this year from its original site.

Initially, I tried to directly show the PDF as an embed or object tag. However, getting the embedded viewer properly sized was beyond what I wanted to tangle with.

Instead, I took the same approach github does: Convert the first pages of the pdf to images and display them with the img tag. This then gets the lightbox treatment from my mkdocs setup, so you can comfortably zoom the page image to its full 150dpi majesty.

I have made the decision to not worry too much about specially-crafted PDF files that might exploit bugs in poppler's pdftoppm: I'll have already locally viewed any PDF I'm putting in the junk drawer, so the Bad Thing will already have occurred. Anyway, the site generation process installs the latest packaged pdftoppm so I'm also likely to have patches for known poppler flaws.

The main downside I've identified is that the image is just an image and is therefore not searchable with the browser's search feature. Alas.



Entry first conceived on 30 July 2026, 14:39 UTC, last modified on 30 July 2026, 15:41 UTC
Website Copyright © 2004-2024 Jeff Epler