PDF.js Express Version
8.7.5 Detailed description of issue
we are using pdf viewer with multiples instances with two different id’s.
one with editing features like annotations/redactions etc.
only viewing purpose.
but after initialization any changes was made to the first one for example if we select annotation option the same is appearing in the second viewer as well.
Expected behaviour
Each viewer should work as an independent
Does your issue happen with every document, or just one?
Yes
How are you initializing the 2 instances? Are they mounted on 2 separate DOM elements?
Note that using multiple instances will consume a lot more memory, see this thread for details:
See this forum post for another example of implementation:
Hey Thanks for the quick reply. yes they are mounted in the same page side by side with two different div elements with the id’s like ‘document1’ and ‘document2’.
Running the project, it looks like things are working as expected. Performing an action on one viewer doesn’t invoke the same action on the other viewer:
However, it looks like you are dynamically creating 2 instances instead of creating 2 separate WebViewer instantiation in your app.js file. You will want to keep them separate so you can customize each instance on its own.