Skip to content

v267.8.0 — Bundled pdf.js fallback viewer

Choose a tag to compare

@github-actions github-actions released this 31 Oct 16:55
· 6 commits to main since this release

Browsers that cannot render PDFs inside an iframe — notably Chromium
on Android — showed a placeholder instead of the document. mdrvserve
now bundles pdf.js and swaps it in for those browsers only, so every
browser gets an inline PDF. This is why the release is a minor bump:
the two vendored assets add ~1.5 MB to the binary.

Added

  • Automatic pdf.js fallback. The PDF wrapper page detects browsers
    without an inline PDF viewer (pdfViewerEnabled false, or Chromium
    on Android, whose viewer reports navigator.pdfViewerEnabled but
    refuses iframe embeds) and renders the document through a bundled
    pdf.js canvas viewer instead of the native iframe. Desktop Chrome
    and Firefox keep using their built-in viewers, unchanged. The choice
    can be forced either way with ?pdfjs=1 or ?pdfjs=0 on the page
    URL. The sidebar stays available in both paths.
  • Pinch zoom. In the fallback viewer, pinch gestures zoom the
    current page from 1× to 5×; the canvas is re-rendered at the new
    resolution, so text stays crisp. Moving to another page resets the
    zoom, and a double-tap or double-click returns to fit-width.
  • Horizontal slideshow mode. A toggle in the corner switches the
    fallback viewer to one page per screen with horizontal swipe and
    scroll snapping, plus an n / N page indicator; the choice persists
    per browser.

pdf.js 3.11.174 (Apache-2.0) is vendored into the binary and served
lazily from /pdf.min.js and /pdf.worker.min.js, fetched only when
the fallback is actually used.