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
| Parameter | Type | Description |
|---|---|---|
| handlerId | string | ID of the handler to scale. |
| dimensions | PageDimensions | PageDimensions to fit into. |
| margins | Margins | Optional 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. |
| units | Units | Optional units, defaults to CENTIMETERS. |
Returns:
number