Mercurial > gemma
changeset 3018:42d1e31de844
client:give the generated pdf name and improve canvas size
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Thu, 11 Apr 2019 17:38:54 +0200 |
parents | 9a408a8b74b8 |
children | 4b9e83cf82ea |
files | client/src/components/fairway/Fairwayprofile.vue |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue Thu Apr 11 16:56:15 2019 +0200 +++ b/client/src/components/fairway/Fairwayprofile.vue Thu Apr 11 17:38:54 2019 +0200 @@ -148,16 +148,16 @@ } var pdf = new jsPDF("p", "pt", "c2"); var canvas = document.createElement("canvas"); - canvas.width = 1500; - canvas.height = 500; + canvas.width = window.innerWidth; + canvas.height = window.innerHeight/2; canvg(canvas, svg, { ignoreMouse: true, ignoreAnimation: true, ignoreDimensions: true }); var imgData = canvas.toDataURL("image/png"); - pdf.addImage(imgData, "PNG", 50, 200); - pdf.save(); + pdf.addImage(imgData, "PNG", 70, 200); + pdf.save("Fairwayprofile-diagram"); }, calcRelativeDepth(depth) { /* takes a depth value and substracts the delta of the relative waterlevel