Cancels a PdfPage.render that has not started yet.
Create one with PdfPage.createCancellationToken and pass it as PdfPageRenderOptions.cancellationToken. Cancelling makes render resolve to null. A render already running in the worker cannot be interrupted — it finishes, and its result is discarded.
render
null
A token belongs to a single render; create a new one per call.
const token = page.createCancellationToken();const image = await page.render({ fullWidth, fullHeight, cancellationToken: token });if (!image) return; // cancelled (or the document was disposed) Copy
const token = page.createCancellationToken();const image = await page.render({ fullWidth, fullHeight, cancellationToken: token });if (!image) return; // cancelled (or the document was disposed)
Whether cancel has been called.
Cancels the render. If it is still queued it never runs and render resolves to null; if the worker already started it, the result is discarded when it arrives. Idempotent.
Cancels a PdfPage.render that has not started yet.
Create one with PdfPage.createCancellationToken and pass it as PdfPageRenderOptions.cancellationToken. Cancelling makes
renderresolve tonull. A render already running in the worker cannot be interrupted — it finishes, and its result is discarded.A token belongs to a single render; create a new one per call.
Example