pdfrx_web
    Preparing search index...

    Class PdfImage

    Result of rendering (a part of) a page: RGBA8888 pixels, ready for Canvas 2D and WebGL without any channel conversion.

    The engine renders in native BGRA order, but the worker swaps channels while copying the bitmap out (effectively free), so pixels is already RGBA — the only pixel format the web can consume directly. See PdfPage.render.

    Index
    • Parameters

      • width: number

        Width of the bitmap in pixels.

      • height: number

        Height of the bitmap in pixels.

      • pixels: Uint8Array

        RGBA8888, tightly packed, width * height * 4 bytes.

      Returns PdfImage

    height: number

    Height of the bitmap in pixels.

    pixels: Uint8Array

    RGBA8888, tightly packed, width * height * 4 bytes.

    width: number

    Width of the bitmap in pixels.

    • Creates an ImageBitmap, which is cheaper to draw repeatedly than putImageData.

      Returns Promise<ImageBitmap>

      The converted Promise.

    • Wraps the RGBA pixels in an ImageData for Canvas 2D. Zero-copy: the returned ImageData shares this image's pixel buffer, so do not mutate pixels afterwards if you keep using the ImageData.

      Returns ImageData

      The converted ImageData.