Maintenance - Mise à jour mensuelle Lundi 7 Décembre 2021 entre 7h00 et 9h00

Commit e330eaf3 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

export png ok

parent 65d07231
...@@ -2058,13 +2058,21 @@ ...@@ -2058,13 +2058,21 @@
$(this).css('border-color', "white"); $(this).css('border-color', "white");
}); });
select_form.hide(); select_form.hide();
alert("TODO") var export_canvas = document.createElement( "canvas" );
/*html2canvas($("#frame")).then(function(canvas) { export_ctx = export_canvas.getContext( "2d" );
var img = canvas.toDataURL("image/png"); export_canvas.width = __canvasWidth;
$('#data-export').attr("href", img); export_canvas.height = __canvasHeight;
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + window.btoa(__context.getSerializedSvg(true)));
img.setAttribute('height', '700px');
img.setAttribute('width', '500px');
img.onload = function() {
export_ctx.drawImage( img, 0, 0 );
var export_img = export_canvas.toDataURL("image/png");
$('#data-export').attr("href", export_img);
$('#data-export').attr("download", "jVenn_chart.png"); $('#data-export').attr("download", "jVenn_chart.png");
$('#data-export')[0].click(); $('#data-export')[0].click();
});*/ };
}); });
$("#format-svg").click(function(event) { $("#format-svg").click(function(event) {
$("#canvasExport").css('background', ceColorOri); $("#canvasExport").css('background', ceColorOri);
...@@ -2078,7 +2086,7 @@ ...@@ -2078,7 +2086,7 @@
$(this).css('border-color', "white"); $(this).css('border-color', "white");
}); });
select_form.hide(); select_form.hide();
var svgContent = "data:image/svg+xml;base64,"+window.btoa(__context.getSerializedSvg(true)), var svgContent = "data:image/svg+xml;base64," + window.btoa(__context.getSerializedSvg(true)),
encodedUri = encodeURI(svgContent); encodedUri = encodeURI(svgContent);
$('#data-export').attr("href", encodedUri); $('#data-export').attr("href", encodedUri);
$('#data-export').attr("download", "jVenn_chart.svg"); $('#data-export').attr("download", "jVenn_chart.svg");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment