vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
2 lines (1 loc) • 626 B
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./html2canvas.esm-D53btDlk.cjs"),u=require("./jspdf.es.min-Rw70uifz.cjs");function r({domElement:f,fileName:p}){if(f){const t={height:851.89,width:595.28},e=new u.E("","pt","a4");let d,g,h,n,a;return c.default(f).then(o=>{d=o.width,g=o.height;let i=g;const s=d/t.width*t.height;let l=0;if(h=t.width,n=582.28/d*g,a=o.toDataURL("image/png",1),i<s)e.addImage(a,"PNG",33,24,h*.9,n*.9,"","FAST");else for(;i>0;)e.addImage(a,"PNG",33,l,h*.9,n*.9,"","FAST"),i-=s,l-=t.height-24,i>0&&e.addPage();e.save(`${p}.pdf`)})}}exports.default=r;
;