Best way to asynchronously update initialized WebViewer instance?
234 views
Skip to first unread message
Tim McElwee
unread,
Jun 27, 2017, 3:03:25 PM6/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PDFTron PDFNet SDK
I'm just getting started digging into using the WebViewer in our Angular 2 SPA. I've been digging through the examples and I don't see an example of asynchronously updating the initialized instance of a WebViewer. Am I just missing this? Can someone point me in the right direction?
Currently, I have change detection setup to initialize the viewer. Works great on the first change, but not on subsequent clicks. I don't really want to have to destroy the current instance and take the hit of building the viewer again with each new document. I'd really like to get a seamless experience when the user moves to the next document in the list.
Thanks in advance if you can offer any help.
Ryan - PDFNet Developer
unread,
Jun 29, 2017, 12:34:38 PM6/29/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PDFTron WebViewer
Posting on behalf of another customer.
I use the WebViewer in an Ionic 2 app (which uses Angular 2). I only build the WebViewer once and then load subsequent documents with code like this:
When I initially setup the WebViewer instance I hook into the documentLoaded event in order to load annotations etc. for each document after it is loaded into the viewer: