Page rendering events in JavaScript PDF Viewer
24 Jun 20261 minute to read
In the PDF Viewer, the pageRenderInitiate and pageRenderComplete events occur during page rendering.
pageRenderInitiate
Triggered when page rendering begins. Use this event to initialize or set up resources before rendering starts, or to display a progress indicator.
pageRenderComplete
Triggered when page rendering completes. Use this event to perform cleanup, hide progress indicators, or finalize rendering-related tasks.
pdfviewer.pageRenderInitiate = args => {
// This method is called when the page rendering starts
console.log('Rendering of pages started');
console.log(args);
};
pdfviewer.pageRenderComplete = args => {
// This method is called when the page rendering completes
console.log('Rendering of pages completed');
console.log(args);
};The provided code demonstrates how to subscribe to these events in the PDF Viewer component.