Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large files once again taking long time to load #1468

Open
kdv24 opened this issue Mar 19, 2023 · 14 comments
Open

Large files once again taking long time to load #1468

kdv24 opened this issue Mar 19, 2023 · 14 comments
Labels
core enhancement New feature or request
Milestone

Comments

@kdv24
Copy link

kdv24 commented Mar 19, 2023

@phuocng I wonder if one of the updates has interfered with the web optimization you addressed here. Our pdfs are not being displayed until the entire 2000 plus page pdf has loaded. This is resulting in very long load times. Would you mind testing with your dummy 5000 page pdf and seeing it you have the same result now? Thank you very much.

@kdv24
Copy link
Author

kdv24 commented Apr 4, 2023

@phuocng I sent you an email with a bit more info on this one.

@kdv24
Copy link
Author

kdv24 commented Apr 16, 2023

Hi @phuocng I know you have a lot you're on top of with this library, but would love to know if you've had a chance to look at the long load time issue? I'm wondering if this issue is related? Thanks. I really do appreciate your work on this!

@Deuscx
Copy link

Deuscx commented Apr 20, 2023

Same Issue. Is it able to get less page for first render
packages/core/src/layouts/PageSizeCalculator.tsx

// render less page initial
const queryPageSizes = Array(doc.numPages)
            .fill(0)
            .map(
                (_, i) =>
                    new Promise<PageSize>((resolve, _) => {
                        getPage(doc, i).then((pdfPage) => {
                            const viewport = pdfPage.getViewport({ scale: 1 });
                            resolve({
                                pageHeight: viewport.height,
                                pageWidth: viewport.width,
                                rotation: viewport.rotation,
                            });
                        });
                    })
            );

@phuocng phuocng added this to the 4.0.0 milestone May 6, 2023
@phuocng phuocng pinned this issue May 6, 2023
@greg-clarity
Copy link

I've been looking at this issue as well (I work with Kelly). Here is what I've observed:

Using React PDF Viewer

  • With a very simple React app
  • Loading a 700+ page, 50MB PDF file
  • Displaying page 555 initially
  • App and PDF on an AWS server (not running locally)
  • Browser cache disabled
  • The network tab shows 150+ of the Range: bytes=... requests, each about 65K in size.
  • No page of the PDF renders until the full PDF file loads, which takes 7-8 seconds.

Using React PDF Viewer

  • with a build from last year (using an older version of React PDF Viewer)
  • ...other parameters the same
  • I see far fewer of the small Range: bytes=... requests - 10 or so.
  • ...but the page rendering isn't any faster. It won't show any pages until the entire PDF file loads.

Using pdf.js directly

  • No React PDF Viewer
  • A simple integration based on this example: https://github.com/mozilla/pdf.js/blob/master/examples/learning/prevnext.html
  • Same PDF file and same server environment
  • Still loading page 555 (not the first page)
  • Browser cache disabled
  • 13 of the Range: bytes=... requests
  • PDF page renders almost instantly (less than 1 second).
  • Full PDF file completes loading after the PDF page has rendered in 4-5 seconds.
  • I can begin navigating between pages as soon as page 555 renders.

I've looked a little into the React PDF Viewer code, but don't understand it well enough to identify what's different with how it renders PDFs vs. the pdf.js example linked to above. I'm hoping you'll be better able to answer that mystery.

Thanks for your help in advance, and please reach out if having access to the example page URLs or our test code would help with your debugging.

@kdv24
Copy link
Author

kdv24 commented May 16, 2023

Thanks for adding that Greg! @phuocng has been amazing about continuing to update and improve the react-pdf-viewer and being responsive.

@vicent4no
Copy link

Hello! Just for the sake of emphasizing this issue.

We have an application that uses React-Pdf-Viewer and we are having long PDF load times due to this issue.
Just to note that there are more people that are directly affected by this

By the way, thanks for this amazing library. Hope I could help you further with this but unfortunately I lack the knowledge and skills.

@jabidof
Copy link

jabidof commented Aug 10, 2023

Same here...
Thanks for the great app!

@kdv24
Copy link
Author

kdv24 commented Oct 3, 2023

@phuocng do you have a sense of when milestone 4.0.0 is likely to be released?

@kdv24
Copy link
Author

kdv24 commented Jan 2, 2024

Hi @phuocng 👋
I'm just wanting to be sure this is still on your radar, and checking in to see if you have any updates for us on it's status. Thank you, and happy new year!

@phuocng phuocng modified the milestones: 3.13.0, 4.0.0 Jan 3, 2024
@phuocng
Copy link
Member

phuocng commented Jan 3, 2024

@kdv24 The issue is fixed in the latest code, and it will be included in v4.0. I can't say exactly when v4.0 comes, but I have been working hard on it. It will be a big release with many improvements and refactors.

@phuocng phuocng added enhancement New feature or request core labels Jan 3, 2024
@DSK9012
Copy link

DSK9012 commented Feb 8, 2024

Just commenting if someone facing this slow loading or unresponsive issue with ""Aww, Snap..." error. See this issue #1717

@MuskanWork
Copy link

@kdv24 The issue is fixed in the latest code, and it will be included in v4.0. I can't say exactly when v4.0 comes, but I have been working hard on it. It will be a big release with many improvements and refactors.

Hello @phuocng , I am looking forward to buy your product, its amazing, all of my feature are customised. but one feature that is mandatory for my application is partial loading or I can say lazy loading, If you assured me with the release date of your new version with this feature, I am super interested to buy your product. Also please let me know new version will support which version of react so that I must be updated with my application.
Looking forward for your positive response

@omriperi
Copy link

Waiting for this release and waiting for version 4 :)

@cindyloo
Copy link

cindyloo commented Apr 1, 2024

Also eager to help test the new 4.0. Have some highlighting updates in my fork and would love to see how it integrates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants