Web SDKv1.0.0

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

  • ABORTED if destroy() comes first.
  • PAGE_ERROR when the file's fields or pages cannot be wired (the viewer stands; the error event reports it too).

Example

TypeScript
const viewer = new PDFViewer(container, doc);
await viewer.whenReady();
hideLoader();

More in PDFViewer