Skip to main content

Home > @jsplumbtoolkit/browser-ui > 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.


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


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.