PhotoeditorSDK - how to implement export function

187 views Asked by At

I'm leaving my moving from a flash based image editor for our custom CMS to the last minute I know, but PhotoeditorSDK seems to be the thing we need. However my Javascript programming is not up to much so I'm struggling with how to deal with the resultant image I want to export. I can upload and pass the file to the editor no problem.

I just want to post the resulting processed image to my file handling (which is CFML Lucee) by passing it a file or url or form field - doesnt matter which really. But the documentation on the SDK only appears to be limited to this (in the export documentation)

 editor.on(UIEvent.EXPORT, async (image) => {
    // todo: handle exported image here

So I'm stuck. What I would like to happen is to have the resulting image (post editing) sent to my script, where I can do what I need to to on solid ground.

Any suggestions or areas to explore greatfully received

1

There are 1 answers

3
Dawesi On

A lot of these editors export DIRECTLY from the browser using SVG or other techniques, so chances are that is what they are doing.

to export or save image simply just redirect to the url of the download which will download the file without navigating the page. you can add any params you want to the get request including the base64 of image

document.location='./imageout.cfm?content='+image; (or whatever url generates the exported doc and myimageref is the variable with a reference or path of what to export.

Any docs url we can look at?

otherwise you can just create a form object in js and submit the form with image as a field with POST.