Skip to main content

Home > @jsplumbtoolkit/print > scaleToPageSize

scaleToPageSize() function

Instructs the given handler to zoom its content so that it would fit into a page of the given size. We currently know about LETTER, A5, A4, A3, A2, A1, A0 and FULL (which is the same as calling scaleToFullPage). Note that this method returns an array serialized as a string.

Signature:

export declare function scaleToPageSize(handlerId: string, size: PageSize, margins?: Margins, units?: Units): String;

Parameters

ParameterTypeDescription
handlerIdstringID of the handler to scale.
sizePageSizePageSize 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:

String