This sample shows how to use Diagram.makeImageData with the returnType: "blob" option and the necessary callback option. It also shows how to download a file that the page has generated.


GoJS Features in this sample

Exporting Raster Images

GoJS has two functions for creating raster images: Diagram.makeImageData, which outputs a Base64 image data string, and Diagram.makeImage, which is a convenience function that calls Diagram.makeImageData and returns a new HTMLImageElement with the image data as its source. Both functions have the same single argument, a JavaScript Object that contains several definable properties, enumerated in the documentation. More information can be found in the GoJS Intro.

Related samples