Pdf Viewer
Thin wrapper that embeds a PDF via the browser's native PDF renderer using an iframe, with an optional toolbar and download link.
Preview
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
src | string | — | URL of the PDF to display. |
height | string | 600 | Viewer height as a number (converted to px) or any CSS length. |
download | boolean | — | Shows a download link in the toolbar. |
title | string | — | Display name shown in the toolbar; falls back to the filename from src. |
Installation
pura is copy-paste and dependency-free. Load the whole library, or just this component.
<link rel="stylesheet" href="/pura/tokens.css">
<script type="module" src="/pura/lib/pdf-viewer.js"></script> import "./pura/lib/pdf-viewer.js";