Returns the thumbnail for pageNumber, rendering it if necessary.
Concurrent requests for the same key share one render.
The viewer value (PdfrxViewer).
The 1-based page number.
The width.
The resolved Promise.
Drops bitmaps no live page refers to any more (e.g. after a rotation).
The viewer value (PdfrxViewer).
Empties the cache and rebinds it to document.
The PDF document to process.
Caches rendered page thumbnails so a scrolling sidebar does not re-render the same page through the worker over and over.
Entries are keyed by PdfPage.renderKey (source page + rotation) rather than by page number, which is what makes reordering pages free:
setPagesrenumbers pages without changing any render key, so the sidebar repaints without a single re-render. Rotating a page does change its key, and the now-unreferenced bitmap is dropped by prune.The cache is per-document:
renderKeyembeds the document handle, and handles are recycled after a document is disposed, so it is cleared whenever the viewer's document instance changes.