Skip to content

Gslmao/pdf viewer new#489

Open
Gslmao wants to merge 3 commits intoCodeChefVIT:stagingfrom
Gslmao-s-Org:Gslmao/pdfViewerNew
Open

Gslmao/pdf viewer new#489
Gslmao wants to merge 3 commits intoCodeChefVIT:stagingfrom
Gslmao-s-Org:Gslmao/pdfViewerNew

Conversation

@Gslmao
Copy link
Copy Markdown
Contributor

@Gslmao Gslmao commented Apr 11, 2026

📌 Purpose

Migrates the PDF viewer from react-pdf to embedpdf with the Pdfium WASM engine for improved rendering performance and a more modular plugin architecture.

Corresponding issue: closes #472


🖼️ Showcase

Desktop View
image

Desktop view fullscreen
image

Mobile View
image

Mobile View Fullscreen
image


🔧 Changes

  • Engine: Swapped react-pdf for embedpdf with viewport, scroll, zoom, render, document manager, and export plugins.
  • Scroll & Zoom: Removed manual pageRefs scroll tracking, offsetTop math, and the wheel event handler.
  • Toolbar: Extracted into a standalone memoised Controls component. Added a useBreakpoint hook to handle responsive layout, consolidating the three previously duplicated toolbar variants (mobile, desktop, fullscreen) into one component with a resolved layout per breakpoint.
  • Performance: toggleFullscreen, handleDownload, and the plugins array are all stabilised with useCallback/useMemo to prevent unnecessary re-renders of the memoised Controls.

➕ Additional Notes

  • The flickering of the pages when zooming and in and out was fixed

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.

Consider replacing current PDF viewer with https://www.embedpdf.com/

1 participant