I rebuilt a PDF viewer over a toolbar
The browser's built-in PDF viewer puts someone else's UI inside my share links, so I rendered the pages myself with pdf.js.
A share link on this site is a first impression. I send someone a file, they open a short URL, and the page is dressed like the rest of my name: my type, my dark background, a preview of the file right there. Then they would click a PDF and the browser's built-in viewer took over the frame: grey chrome, its own toolbar, a print button and a download button I did not place. Someone else's product, center stage in mine.
I tried the polite fixes first. Embedding a PDF with hash parameters like toolbar=0 is advisory: Chromium mostly listens, Safari and Firefox render whatever UI they feel like, and your CSS ends at the iframe boundary regardless. There is no styling a native viewer, because there is nothing of yours inside it to style. Yesterday that stopped being acceptable, and I did the thing I had been avoiding: pdf.js, rendering pages to canvas myself.
Owning the render means owning everything I used to get free. Pagination is mine now, previous and next controls instead of an infinite grey scroll. Resolution is mine, pages render at full quality instead of whatever the plugin decided. Even the scrollbar is a decision: it stays visible always, because a scrollbar that appears only on overflowing pages changes the content width from page to page, and the layout twitches every time you paginate. That twitch is precisely the kind of defect you cannot fix in an embed you do not own, and precisely the kind you can delete in an afternoon when the canvas is yours.
The price was five commits in one day for functionality every browser ships free, and a rendering pipeline I now maintain forever. The same push grew the rest of the preview surface while I was in there: images render inline, PowerPoint files get an in-page preview, and everything opens into a full-screen viewer, so the share page now handles the formats clients actually send without ever leaving my layout. The share cards even got a QR code as their social embed image, with the share's title on the card, because a link that gets opened on a phone from a laptop screen is a real path I keep watching happen.
Here is the opinion underneath the yak shave: default browser chrome inside a product surface reads as unfinished, even though it is free, accessible, and familiar. Not because users consciously notice the toolbar, but because they notice the seam, the moment your page hands them to a different designer mid-task. For an internal tool I would take the native viewer without a second thought; at one user, seams are free. On the single page a client opens with my name on it, the toolbar was the bug.
Nobody who opens a share link will notice any of this. Noticing was the thing I removed.