Printing

yFiles FLEX offers support for customized printing as well as a convenience method for common printing scenarios.

CanvasComponent's methods for printing support are listed in API Excerpt 4.14, “CanvasComponent support for printing”.

API Excerpt 4.14. CanvasComponent support for printing

// Print the current canvas content, scaled to fit the page
function print(bitmap:Boolean = true, borderSize:uint = 5):void

// Create a Sprite object containing the current canvas content
function createSprite():Sprite

The print method takes the current content rectangle of the CanvasComponent into account for scaling the content down to fit the page. Note that if the content rectangle is smaller than the printable page size, the content will not scale up to fit the page.

If more flexibility is needed for printing, a Sprite containing a complete copy of the current canvas content can be retrieved using createSprite. The obtained Sprite can then be modified and printed using standard Flex printing support.

Note that SWF node styles that were loaded using a Base64 serialization will currently not be included in the printed document since they cannot be cloned.