Skip to content

Instant Display of Large PDF Files: Modifying pdf-js Components for Background Downloading #312

Closed

Description

@rocheston

I have PDF files exceeding 200MB, and pdf-js requires downloading the entire file before displaying the first page, which is time-consuming. How can I modify components/app/pdf to instantly display the page while simultaneously downloading the file in the background?

My pdf files are linearized.

Activity

  1. DustinBrett commented on May 29, 2023

    @DustinBrett
    Owner

    Hi @rocheston, thanks for the question. This will be tricky for a few reasons, one of them being that the PDF app is not very efficient when loading large PDF's currently, even once it has the entire file local. I had planned at some point to add lazy loading to how it loads the pages because as it is now it can get quite slow when it's many pages. As for loading in the background or via streaming, that is another complexity as I am not sure if PDF's can be loaded intermittently, and if they can I imagine it would be something pdf.js would need to support. I don't know enough about PDF's to even say what a "linearized" means in the context of being able to load it this way. I will add this as a feature request and in the mean time if you find anything in the pdf.js docs/repo about how to do this please post it here and I can give further advice on how to integrate the feature.

  2. Repository owner locked and limited conversation to collaborators on May 29, 2023
  3. converted this issue into a discussion #313 on May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions