I've added the PDF viewer to my react project, and I'm testing with a PDF of 40 pages, with images as well.
I used the jquery PDF viewer before, which wasn't laggy. But the React PDF Viewer component, is visibly lagging mainly when navigating pages (going back or forth for example).
Is there anything we can do to optimise for this?
Hello, Dide,
The PDFViewer uses another external library under the hood Pdf.js and currently, we don't have any mechanisms that will optimize the performance of the component.
I created a project that uses the PDFViewer with a large pdf of 51 pages that also contains images, however, it seems that the navigation is working properly on my end without lagging. You can find the test project as an attachment. I am using version 114.0.5735.133 of Chrome browser. Does the lagging occur for a specific browser only? Is it possible to modify the example with your implementation so that the lagging reproduces and we can test further?
Regards,
Filip
Hi Filip,
Thank you for getting back to me. I just re-tested this and don't see the lag happening now. I will keep you posted if I find out what's going on.
Many thanks,
Dide