I am using PDF.JS to render pdf pages into different canvas elements. my requirement is to capture the output of the canvas and to display it as an image. Is there some even
Depending on which components (and version) of PDF.js you are making use of, you can also use the EventBus.
If you are using the simplest implementation of PDF.js then this might not be available, but if you are using their SimpleViewer or PageViewer examples, try this:
eventBus.on("pagesloaded", function() {
console.log('pagesloaded');
// your code here
});
eventBus should already be defined, if not, you can set it up using:
var eventBus = new pdfjsViewer.EventBus();
Again, this depends on the level of complexity in your PDF Viewer. Turns out there are many different layers within PDF.js.
To listen for every page load, use the eventBus event 'pagerendered'