Skip to main content

Home > @jsplumbtoolkit/print > scaleToBounds

scaleToBounds() function#

Instructs the given handler to zoom and pan its content so that it would fit into the given width and height (which are pixel values). This is used when printing if we wish to fix to a specific page size like A4.

Signature:

export declare function scaleToBounds(handlerId: string, wh: PageBounds, margins?: Margins): number;

Parameters#

ParameterTypeDescription
handlerIdstringThe ID of the handler to scale.
whPageBoundsWidth and height (in pixels) to zoom to
marginsMarginsOptional margins in [top,right,bottom,left] format. In this method, these values are expressed as pixel values.

Returns:

number