Export tool allows downloading and exporting image or current editor data in various formats.
Default Parameters
Export tool defaults can be specified via defaultFormat
, defaultQuality
and defaultName
parameters. These will affect "save" button as well.
<script>
var pixie = new Pixie({
tools: {
export: {
defaultFormat: 'png', //png, jpeg or json
defaultName: 'image', //default name for downloaded photo file
defaultQuality: 0.8, //works with jpeg only, 0 to 1
}
}
});
</script>
Export tool methods
export
-
Parameters
-
Default value name: string = "image"
-
Default value format: "png" | "jpeg" | "json" = "png"
-
Default value quality: number = 0.8
Returns void
-
getDataUrl
-
This will return current photo as base64 encoded data.
Parameters
-
Default value format: "png" | "jpeg" | "json" = "png"
-
Default value quality: number = 0.8
Returns string
-
Export tool parameters
Name | Type | Description |
name |
string |
name of photo. Should not include extension. |
form |
string |
format of export data. png , jpeg or json . Specifying json as format will export current editor state in json, instead of a photo. |
quality |
number |
Quality of exported photo. Between 0 and 1. Only works with jpeg format. Defaults to: 0.8 |
Main export function. By default this is called when user clicks
save
button in pixie interface. It will apply watermark (if specified) and execute one of the actions below in this order of priority:saveUrl
option in pixie configuration.onSave
option in pixie configuration.