destroy / re-create webviewer javascript

87 views
Skip to first unread message

Danny Mendel

unread,
Jun 8, 2016, 4:56:47 PM6/8/16
to PDFTron WebViewer
hi guys,

as currently loadDocument() is not firing changeAnnotation events or doing any sort of importAnnotationsAsync() which i reported few times, i need a solution for re-genrating webviewer dynamically.
can you plesae provide a sample code that shows how can I
destroy & re-create of webviewer instance decoupled together? i failed to succeed with it. and even though a instance is created it doesn't give me acces to properties such as docID or method like loadDocument()
so please provide an alternative solution of dynamically destroy/create new instance on-the-fly so i can call loadDocument() "once" instead of having issues with annotation reset of events for 2nd load and so forth.

Many Many thanks
Danny


Matt Parizeau

unread,
Jun 9, 2016, 3:46:29 PM6/9/16
to PDFTron WebViewer
Hi Danny,

With the response here https://groups.google.com/d/msg/pdfnet-webviewer/zdW6S8F68VA/7gsbyCaiBQAJ, hopefully you no longer need to use a solution which destroys and recreates the viewer.

However if you still want to do this you can refer to the offline library sample included in the WebViewer download which recreates the viewer every time you switch documents.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages