You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I load and render all pages of a PDF file in individual React components and still maintain a search function across all pages?
Hi, I am trying to create my own pdf-viewer with pdf.js as core library and Vite, ReactJS as framework.
This viewer is meant to render PDFs with 1000+ pages efficiently, which works well through the react-window library.
This works according to the following scheme:
I manage to implement a search function when I render all pages in one component
For this I followed the "simpleviewer" example.
I also managed to load the pages in individual components by fetching and rendering the pages individually with pdf.getPage(n) as shown here.
I also want to mention, that I have read many issue reports about the SinglePageViewer, RenderingQueues and PageViewer, which did not help me with my problem.
TLDR:
How can I retrieve individual pages from the PDFViewer and render them in separate components and still have a search function?
Rendering pages individually in a separate viewer is not a problem
Implementing a search function is not a problem
The problem is the combination
SinglePageViewer, PageViewer or RenderingQueues do not seem to have helped
This discussion was converted from issue #17990 on April 23, 2024 12:25.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
How can I load and render all pages of a PDF file in individual React components and still maintain a search function across all pages?
Hi, I am trying to create my own pdf-viewer with pdf.js as core library and Vite, ReactJS as framework.
This viewer is meant to render PDFs with 1000+ pages efficiently, which works well through the react-window library.
This works according to the following scheme:
I manage to implement a search function when I render all pages in one component
For this I followed the "simpleviewer" example.
I also managed to load the pages in individual components by fetching and rendering the pages individually with pdf.getPage(n) as shown here.
I also want to mention, that I have read many issue reports about the SinglePageViewer, RenderingQueues and PageViewer, which did not help me with my problem.
TLDR:
How can I retrieve individual pages from the PDFViewer and render them in separate components and still have a search function?
SinglePageViewer, PageViewer or RenderingQueues do not seem to have helped
Attachments and Configurations
Attach (recommended) or Link to PDF file here:
https://api.printnode.com/static/test/pdf/multipage.pdf (dummy pdf)
Configuration:
Beta Was this translation helpful? Give feedback.
All reactions