February 21, 2023, 9:58am
Which product are you using?
PDF.js Express Plus
PDF.js Express Version
Detailed description of issue
When I open huge document then I waiting for rendering. Before document is full rendered I close (hide) viewer and them it’s look like pages are still rendered in background - my site and browser are slowdown (till I reload page).
I hide viewer according to
and on hide viewer I also try to relase resources
How can I cancel rendering and release resources properly?
Rendering is cancelled, all resources are released properly and no operation is performed in the background.
Does your issue happen with every document, or just one?
February 21, 2023, 6:40pm
Can you provide a sample project to reproduce this issue?
February 22, 2023, 7:33am
I loaded document with
and after some time close them and try to release resources as I already mentioned.
How exactly I should close, stopping background operations and release resources properly of viewer?
February 22, 2023, 8:42am
Please ensure any references to the viewer have been cleared or any properties being saved, this can keep a reference to the instance stored in memory.
If you are still downloading the document from the server or fetching data, you’ll need to cancel that as well.
February 28, 2023, 8:53am
Thank you, I’m ensured of that.
Could you explain me, which exactly functions I should call when I close (hide) webviewer (to achive stop rendering and release resources)?
I would first dispose the DocumentViewer using (be sure to dereference any refs to documentviewer:
let docViewer = instance.Core.documentViewer.
docViewer = null;
And then do the same for the UI (same with the derefrencing):