Skip to main content

Home > @jsplumbtoolkit/print > scaleToPageDimensions

scaleToPageDimensions() function

Instructs the given handler to zoom its content so that it would fit into a page of the given dimensions. The values are in centimetres, unless you specify in the third argument to the method that the dimensions are inches.

Signature:

export declare function scaleToPageDimensions(handlerId: string, dimensions: PageDimensions, margins?: Margins, units?: Units): number;

Parameters

ParameterTypeDescription
handlerIdstringID of the handler to scale.
dimensionsPageDimensionsPageDimensions to fit into.
marginsMarginsOptional margins to use (in [top,right,bottom,left] format). Values here are expressed in whatever you specify for units, which defaults to CENTIMETERS if you leave it empty.
unitsUnitsOptional units, defaults to CENTIMETERS.

Returns:

number