You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pdfjsLib.GlobalWorkerOptions.workerSrc='https://mozilla.github.io/pdf.js/build/pdf.worker.mjs'// SweetAlert2 popupSwal.fire({title: 'PDF Preview',html: '<canvas id="pdfCanvas"></canvas>',width: 'auto',didOpen: async()=>{constpdfUrl='https://pdfobject.com/pdf/sample.pdf'constloadingTask=pdfjsLib.getDocument(pdfUrl)constpdf=awaitloadingTask.promise// Fetch the first pagepdf.getPage(1).then(function(page){varviewport=page.getViewport({scale: 1.5})// Prepare canvas using PDF page dimensionsvarcanvas=document.getElementById('pdfCanvas')varcontext=canvas.getContext('2d')canvas.height=viewport.heightcanvas.width=viewport.width// Render PDF page into canvas contextvarrenderContext={canvasContext: context,viewport: viewport,}page.render(renderContext)})},})
https://mozilla.github.io/pdf.js/
sweetalert2/sweetalert2#1781
The text was updated successfully, but these errors were encountered: