Skip to main content

Home > @jsplumbtoolkit/print

Classes

ClassDescription
PrintHandler

Functions

FunctionDescription
isReadyToPrint(handlerId)Returns whether or not the handler with the given id considers itself ready to print. if no such handler is found we also return false; it is entirely possible that this call could be made before the handler has been instantiated.
registerHandler(surface, id)Register a print handler for the given surface, optionally with the given id. An id will be generated if not provided.
scaleToBounds(handlerId, wh, margins)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.
scaleToFullPage(handlerId, margins, units)Instructs the given handler to zoom its content to 1, and then report back how big the page needs to be to render the entire dataset. Note that this method returns an array serialized as a string.
scaleToPageDimensions(handlerId, dimensions, margins, units)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.
scaleToPageSize(handlerId, size, margins, units)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.

Type Aliases

Type AliasDescription
Margins
PageBounds
PageDimensions
PageSize
Units