pdfrx icon indicating copy to clipboard operation
pdfrx copied to clipboard

PDF Loading time too much long for big size pdf

Open 90tamal90 opened this issue 1 year ago • 8 comments

When open a big size pdfs , like 500 pages pdf ....then the pdf loading time of too much ...... and memory consumption is too much ....please help me 🙏....

  1. I think here all pages are rendered at same time .....if per page render when scrolling ....
  2. How to implement the loading indicator per page ??

90tamal90 avatar May 26 '24 08:05 90tamal90

I think here all pages are rendered at same time .....if per page render when scrolling ....

No, the rendering is per-page basis. The problem seems in the page layout logic. It firstly calculates the width/height of all the pages.

I've tested pdfrx with large documents like PDF Reference and the loading speed is acceptable even if we dynamically download it.

So if your 500-page document takes so long time, the PDF file's structure is too much complicated. Without the file, we cannot check the actual issue.

If you're just talking about download progress, here it is.

And, the memory consumption is already optimized on the latest version. I think there's already no room to optimize the memory usage on pdfrx. If you need more optimization, we should do some in pdfium.

espresso3389 avatar May 26 '24 18:05 espresso3389

300 pages... 3-5seconds.

lin1270 avatar Jun 12 '24 14:06 lin1270

Please don't reuse a single issue for many things. I ignore all your questions on the issue.

espresso3389 avatar Jun 12 '24 15:06 espresso3389

I think it's quite normal to load 300 pages in 3-5 seconds. Only your issue is it just freezing before showing the pages. I understand your pain. But I'm still thinking how to do that...

espresso3389 avatar Jun 12 '24 15:06 espresso3389

@espresso3389 I think this could be the solution: https://apryse.com/blog/pdf-format/what-is-pdf-linearization https://github.com/mozilla/pdf.js/issues/8897

letrungdo avatar Jun 24 '24 09:06 letrungdo

@letrungdo pdfrx uses pdf.js for web version so PDFJS.disableAutoFetch might be an option though I think it does not work for the case.

By the way, why are you referencing PDF linearization here?

espresso3389 avatar Jun 24 '24 10:06 espresso3389

@espresso3389 PDF linearization I think for pdf files downloaded from url it will be necessary to download the first pages to display first, not having to wait for the file to finish downloading to display.

letrungdo avatar Jun 25 '24 00:06 letrungdo

@letrungdo PDF linearization is how PDF content should be and it has nothing to do with PDF viewer.

espresso3389 avatar Jun 25 '24 06:06 espresso3389

这是一封自动回复邮件。已经收到您的来信,我会尽快回复。

lin1270 avatar Dec 27 '24 02:12 lin1270