Closed foondadom closed 1 month ago
In recent versions the component will destroy the worker if is hidden/unmounted by v-if
, try using v-show
instead.
Thanks so much, will give it a go!
I going to close this issue, feel free to reopen if the it persists
I have to render PDF documents that can be 100+ pages long.
Previously I was loading the PDF as base64, but this is proving very memory intensive.
With the base64 source, this code worked:
showOrHide function:
As you can see I'm using intersection observer (v-intersection) to determine if a page is "in view", then rendering it via a v-if. The opposite happens when the page scrolls out of view. I keep the page "space" (pdf-page-wrapper CSS class) once set to invisible so that the pages don't jump:
.pdf-page-wrapper { aspect-ratio: 380 / 537; }
As mentioned, with base64, this method worked well. However with a local file I am getting no visibility of the 3rd page onwards and the error in Android console is
Cannot read properties of null (reading 'sendWithPromise')
Looking at the source code, it seems the worker.messageHandler is null for the pages that are rendered on demand.
Questions:
Details:
Thanks!