Please give a brief summary of your issue:
Uncaught RuntimeError: memory access out of bounds when opening a PDF in web viewer
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
The issue has come up after we implemented preloading to try and make the web viewer a little faster in our Angular application. The issue is caused when a previous PDF hasn’t been closed, and attempting to open a new one causes the memory out of access exception.
I’ve tried calling the .close() functions as well as the .dispose() functions before and after a document has been loaded, and the issue still seems to persist. Is there a reason why these two functions wouldn’t close the previous PDF that has been opened?
How are you pre-loading the viewer? Have you had a chance to go over our guide on this?
If you are hiding the element with display: none this may cause issues:
Don’t use “display: none” to hide the element
This causes issues with iframes and web workers. Use “visibility: hidden” or “height: 0; width: 0;” instead.
You may see an error like “memory access out of bounds”, NS_ERROR_FAILURE or “getComputedStyle(…) is null”
PDFTron Systems, Inc.
Yes, we followed the guide when implementing the preloading and also avoided using display: none; when hiding the WebViewer between documents. It seems like the previous document hasn’t closed properly, so when a new one is added the browser runs out of memory, even after explicitly calling the functions to do so.
Also, this seems to only be occuring on Chrome. When running the WebViewer in Firefox I run into no memory issues.