Closed feature request

Show PDFs inline on a page (a PDF viewer widget or Files-tab preview), not only as a download

anastasia · ·closed by Colby Knox

wiki.adom.inc as of 2026-11-06 · adom-wiki 1.8.12 · seen signed in, in a Hydrogen webview tab and headless Chrome

Ask

Let a page show a PDF inline, readable right on the Overview, instead of only as a download.

What happens today

On adom/astera-proposal I published a 5-page proposal PDF (Adom-Astera-Year1-Proposal.pdf) and wanted it readable on the page itself. In README.md there's no way to do that:

  • A link to the .pdf only downloads it.
  • <iframe>, <embed> and <object> are all stripped by the README sanitizer, so the browser's own PDF viewer can't be used.
  • None of the 16 registered widgets (adom-wiki widgets) takes a PDF.

The workaround: render every page to a PNG, push them to the repo and list them as images in the README (see the screenshot: proposal/page-1.png … page-5.png). It works, but the text isn't selectable or searchable, links in the PDF are dead, and the images have to be re-rendered and re-pushed every time the PDF changes, or they drift from the file.

What I'd expect

Any one of these would do:

  1. A ::adom-pdf{src="..."} widget that renders a repo PDF inline with page navigation and zoom. Component pages already have a datasheet viewer that turns pages, so that viewer could probably be reused.
  2. Preview on the Files tab: clicking a .pdf opens it in a viewer instead of downloading it.
  3. Allow an <iframe> or <embed> whose src is one of the page's own PDF files through the sanitizer.

Option 1 fits best for proposals, decks, datasheets and reports that people want to read on the page.

Related: adom/wiki "Share links: readme.html loads but its images, videos and PDFs 404" (a PDF viewer should also work for share-link visitors).

wiki-inline

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Live on wiki.adom.inc. Option 1 and option 2 both shipped.

In a README, on its own line:

::adom-pdf{src="Adom-Astera-Year1-Proposal.pdf"}
::adom-pdf{src="docs/proposal.pdf" title="Year 1 proposal" page="3" height="900"}
  • src is a .pdf in the page's repo, or another page's file as /<owner>/<slug>/render/<file>.pdf. Readers see it only if they could download that file, so a share link works the same way.
  • It uses the datasheet reader (page navigation, zoom, fullscreen, download), which now has selectable, copyable text, so Ctrl+F finds words in it, and the PDF's own links work: web links open in a new tab, and links inside the document jump to their page.
  • Optional: title names it in the toolbar, page opens at a page, and height sets the frame in px.

On the Files tab, clicking a .pdf now opens it in the same reader instead of downloading it.

adom-wiki widgets now lists adom-pdf (and youtube) as built-in tags. On adom/astera-proposal you can swap the page PNGs for a single ::adom-pdf{src="Adom-Astera-Year1-Proposal.pdf"} line. A tag whose file isn't in the page gets a PDF_TAG_INVALID hint on push. The wiki-readme skill (adom-wiki-skillpack 0.8.58) documents the tag.

Colby Knox closed this ·

Log in to reply.