Skip to content

feat: PDF.js inline viewer for Android Chrome#36

Open
jamietre wants to merge 2 commits into
mainfrom
feat/pdf-mobile-viewer
Open

feat: PDF.js inline viewer for Android Chrome#36
jamietre wants to merge 2 commits into
mainfrom
feat/pdf-mobile-viewer

Conversation

@jamietre

@jamietre jamietre commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Android Chrome doesn't render PDFs inline in <iframe> — it triggers a download instead
  • PDF.js (pdfjs-dist) is now used on Android to render PDF pages as canvas elements
  • Desktop browsers continue to use the existing <iframe> path unchanged
  • PDF.js is dynamically imported (matching the RTF lazy-load pattern) — only downloaded on first PDF view on mobile

Test plan

  • Open a PDF on desktop Chrome — iframe viewer works as before
  • Open a PDF on Android Chrome — PDF renders inline as canvas pages, scrollable
  • Navigate between PDFs on mobile — each re-render clears previous canvases and shows spinner
  • Open an encrypted PDF on mobile — error message shown

🤖 Generated with Claude Code

jamietre and others added 2 commits April 27, 2026 11:54
Android Chrome does not render PDFs inline in iframes and instead
triggers a download. This adds a PDF.js-based canvas renderer that
activates automatically on Android, while leaving the existing iframe
viewer unchanged on desktop.

PDF.js (pdfjs-dist) is dynamically imported the first time a PDF is
opened on mobile, matching the existing lazy-load pattern used for
RTF rendering via rtf.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant