Hi Nhat,
@pdftron/webviewer also exports a util function that you can use to get the current WebViewer instance.
import { getInstance } from ‘@pdftron/webviewer’;
Assuming you’ve initialized WebViewer already, you can call this function to get the instance and use it in other files.
Another solution I can think of is to put the instance on a React context and useContext in other components to access the instance.
Let me know if this is what you are looking for and if you have any other questions.
Best Regards,
Zhijie Zhang
Software Developer
PDFTron Systems Inc.