PDFViewer.whenReady()
Resolves once the viewer is ready: pages laid out, form fields and tools wired, the pages in view queued to paint — the moment to remove a loading indicator of your own. A progressive document's later pages still arrive after it (doc.whenFullyLoaded() says when every byte has).
methodLifecyclesince 1.0.0
Signature
whenReady(): Promise<void>
Returns
Promise<void>
Throws
ABORTEDifdestroy()comes first.PAGE_ERRORwhen the file's fields or pages cannot be wired (the viewer stands; theerrorevent reports it too).
Example
TypeScript
const viewer = new PDFViewer(container, doc); await viewer.whenReady(); hideLoader();