packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

Is there a way to prerender all pages?

Open timmydan opened this issue 2 years ago • 2 comments

Can the entire pdf be rendered at once rather than each page be rendered as the user scrolls to it? I've got some short pdfs with only a few pages but they contain images. Scrolling to the next page results in a noticeable loading time while each page is rendered. Is it possible to render all the pages at once?

timmydan avatar Dec 16 '21 08:12 timmydan

Or perhaps just to prerender the next page in the background so there is no loading time when you open it? It doesn't have to be all the pages at once.

timmydan avatar Jan 07 '22 08:01 timmydan

Having the same issue. Changing pages hangs the animation for a third of a second because the next page is loading. Returning to a previous page and going forward to the page I was before is faster because whatever cache is being used already contains the page.

An argument with a preset number of pages to preload would probably solve this issue. Even a method on the controller to preload a certain page would allow us to use onPageChanged and onDocumentLoaded to control this caching of the next few pages manually.

Dancovich avatar Jul 10 '22 16:07 Dancovich