Adding a PDF Display to Eleventy 0 ▲ Raymond Camden 6 hours ago · Tech · hide · 0 comments This will be a short one. I've talked about embedding PDFs on web pages for probably close to ten years now. Blame Adobe. Blame me being a nerd and finding this stuff interesting. Blame whoever. While I've blogged about the topic, I've also actually done that on my site here, in a variety of different ways. A while back I realized I wasn't being consistent with how I did... "stuff" here, like call outs, Youtube links, etc. I started a guide doc so I'd have a quick way to remember what I did last time, and be more consistent. One item on there I had left as "figure it out later" was proper PDF embedding. This week I finally nailed that down. EmbedPDF is a library I've mentioned here before so I leaned on it, and went with an incredibly simple snippet: <div id="pdf-dis" style="width: 100%; height: 400px; margin-bottom: 30px"></div> <script type="module"> import EmbedPDF, { ZoomMode } from 'https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js'; EmbedPDF.init({ type:… No comments yet. Log in to reply on the Fediverse. Comments will appear here.