ComPDFKit Web SDK
    Preparing search index...

    Interface LoadCanvasOptions

    Options for loadCanvas.

    interface LoadCanvasOptions {
        drawComplete: (canvas: HTMLCanvasElement, pageNumber: number) => void;
        height?: number;
        layerUsage?: "print" | "view";
        multiplier?: number;
        pageNumber: number;
        pageRotation?: PageRotation;
        renderAnnotations?: boolean;
        renderRect?: { x1: number; x2: number; y1: number; y2: number };
        width?: number;
        zoom?: number;
    }
    Index
    drawComplete: (canvas: HTMLCanvasElement, pageNumber: number) => void

    Called with the rendered canvas and the page number.

    height?: number

    Height of the box to fit in, in CSS pixels; see width.

    layerUsage?: "print" | "view"

    Layer usage: 'print' chooses layers by their print usage (always / never / only when visible), for printing; by the current display by default

    multiplier?: number

    Bitmap multiplier, Core.getCanvasMultiplier() by default

    pageNumber: number

    Page number (1-based).

    pageRotation?: PageRotation

    View rotation on top of the page's own /Rotate

    renderAnnotations?: boolean

    Draws annotations and form widgets (by their appearance in the PDF, as loadThumbnail); false by default, page bitmaps do not include annotations (the viewer's annotation layer draws them). For copy documents without a viewer that need to show annotations

    renderRect?: { x1: number; x2: number; y1: number; y2: number }

    Renders only this region: display-orientation page space (top-left origin, pt)

    Type Declaration

    • x1: number

      Left edge.

    • x2: number

      Right edge.

    • y1: number

      Top edge.

    • y2: number

      Bottom edge.

    width?: number

    With width and / or height, scales proportionally to fit within this box (CSS px, then times multiplier), overriding zoom (for thumbnails). With only one, scales by that side only

    zoom?: number

    Zoom level; 1 renders at 72 pixels per inch before the multiplier.