jatui

PdfThumbnail

PDF first-page thumbnail rendered client-side via pdfjs-dist

First-page render

Each tile fetches a generated PDF and renders page 1 to a canvas client-side (import('pdfjs-dist') → worker → getDocument → page.render). No backend, no binary fixture — the documents are built in the browser as data URLs.

report.pdf
invoice-1042.pdf
scan.pdf

Broken source → fallback icon

Data that isn't a PDF makes getDocument throw; the component swaps the canvas for an error icon instead of rendering a blank tile.

corrupt.pdf

Dependency note

pdfjs-dist is a runtime dependency pinned to the GHSA-hq66-cqwq-w95j fix floor (≥ 6.2.108; currently ^6.3.289) — consumers inherit the fixed major, so no scoped npm override is needed. tests/unit/pdfjsDistFloor.test.ts fails CI if the declaration or lockfile ever regresses below the fix.

Props

PropTypeDefaultDescription
srcstring-URL or data URL of the PDF; page 1 is fetched and painted to the canvas
classstring''Extra CSS classes on the canvas (and the failure icon wrapper)