pdfrx_web
    Preparing search index...

    Class ThumbnailCache

    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: setPages renumbers 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: renderKey embeds the document handle, and handles are recycled after a document is disposed, so it is cleared whenever the viewer's document instance changes.

    Index
    • Returns the thumbnail for pageNumber, rendering it if necessary. Concurrent requests for the same key share one render.

      Parameters

      • viewer: PdfrxViewer

        The viewer value (PdfrxViewer).

      • pageNumber: number

        The 1-based page number.

      • width: number

        The width.

      Returns Promise<HTMLCanvasElement | null>

      The resolved Promise.