It seems that the function provided in the JS API does not actually free memory. For instance if a document is loaded like this :
var myWebViewer = new PDFTron.WebViewer({
type : "html5",
initialDoc : "test.xod",
showToolbarControl : false,
enableAnnotations : true
}, myWebViewerContainer);
How does one close this doc and free memory? We tried :
myWebViewer.instance.docViewer.CloseDocument()
myWebViewer.instance.docViewer.RemoveContent()
myWebViewer.instance.docViewer.Dispose()
Nothing seems to actually clean memory, which leads to very bad performance issue on the website after closing the webviewer.
Could you give me a working example on how to cleanly close the webviewer?
Thanks in advance
myWebViewer.getInstance().closeDocument();
myWebViewer = null;
var iframeWindow = $('iframe')[0].contentWindow;
iframeWindow.$(iframeWindow.document).off();
$(myWebViewerContainer).remove();