1 line
934 B
JavaScript
1 line
934 B
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9114],{59114:(e,a,t)=>{t.d(a,{exportDocsToPdf:()=>r});var o=t(15049),m=t(75334);async function r(e){var a,r;let g,i,c=await (0,o.u)(e,{scale:2}),[{jsPDF:d}]=await Promise.all([Promise.all([t.e(2346),t.e(3356),t.e(6951),t.e(4802)]).then(t.bind(t,5179))]),u=new d({orientation:Number(e.getPageStackElement()?.dataset.docsPageWidth??e.pageLayout.widthPx)>Number(e.getPageStackElement()?.dataset.docsPageHeight??e.pageLayout.heightPx)?"landscape":"portrait",unit:"mm",format:[e.pageLayout.format.widthMm,e.pageLayout.format.heightMm]});for(let a=0;a<c.length;a+=1){let t=c[a].toDataURL("image/jpeg",.92);a>0&&u.addPage(),u.addImage(t,"JPEG",0,0,e.pageLayout.format.widthMm,e.pageLayout.format.heightMm)}a=u.output("blob"),r=(0,m.Ie)(e.sourceName,"pdf"),g=URL.createObjectURL(a),(i=document.createElement("a")).href=g,i.download=r,i.click(),URL.revokeObjectURL(g)}}}]); |