JohnMcLear / ep_draw

Etherpad plugin for Etherdraw
Other
15 stars 22 forks source link

[50€ Bounty] Export Drawing #38

Open AliKarpuzoglu opened 4 years ago

AliKarpuzoglu commented 4 years ago

Hey,

it would be great to have an option to export the drawing. I already have working code to export it as an .svg file, all that would be needed is an extra button.

function download(filename, text) {
    var element = document.createElement('a');
    element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
    element.setAttribute('download', filename);

    element.style.display = 'none';
    document.body.appendChild(element);

    element.click();

    document.body.removeChild(element);
}

canvas = document.getElementById('canvas'); 

var styleNode = document.createElement("style");
styleNode.innerHTML = "path { 
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
} ";
canvas.appendChild(styleNode);

Then you can download the file with

download("file.svg", canvas.outerHTML)

AliKarpuzoglu commented 4 years ago

to be eligible for the bounty, please comment and message me to confirm that no one else is working on it first

ChaituVR commented 4 years ago

@AliKarpuzoglu Can i pick this? If no one started working

AliKarpuzoglu commented 4 years ago

Send me an email @ChaituVR ali (at) alikarpuzoglu.com

ChaituVR commented 4 years ago

@AliKarpuzoglu sent.. Please confirm

ChaituVR commented 3 years ago

I have received the bounty for solving this.. You can close this @AliKarpuzoglu and thank you