Creating new events in the viewer API of PDF.js for better integration with other libraries

I continued to work on PDF.js. This time around I created new events within the viewer API that help better integrate PDF.js with other libraries.

First event that I created is called


Pageremoved was needed so an external library can know exactly when a page is removed from cache. This can be useful if said library wants to release any resources that are associated with that page.

Next event is


This event is pretty self-explanatory. It fires when a document is fully loaded. It can be useful for libs that want to wait to load in resources until the document is loaded.

Last event is


This event fires when the metadata has been fully loaded. Again useful for libs that need to know if the metadata has been loaded before trying to access any of it.

The code can be found at the following PR:

Mohamed Baig

Mohamed Baig

Technology enthusiast and professional software developer. Always curious about new tech. Doesn't matter if it's from devops to frontend.