Pablo

download([type], [filename], [callback]])

Converts the collection to an SVG data URL (see dataUrl()), creates a file from the data URL and initiates its download to the local filesystem, via the browser.

Pablo.circle({r:50})
    .download('png', 'circle.png', function(result){
        alert(result.error ? 'Fail' : 'Success');
    });

type is the image format: "svg" (default), "png" or "jpeg"

filename is the name of the file to be downloaded

callback is a function that is called upon successful and failed download attempts. If the callback is passed an error object, then the attempt failed. The callback is called with this as its context.

Browser support

This is a new browser feature. If the browser supports downloads, then Pablo.support.download will be true.

See Pablo.support for details.

Painting is just another way of keeping a diary.
Pablo Picasso