From 9d717b1c84d254abb6da0bb53f4bd2ffc2ae93f7 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 20 Dec 2024 19:57:53 +0100 Subject: [PATCH] Dynamically import pdf-lib --- plugins/Print.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Print.jsx b/plugins/Print.jsx index f37e2d5e1..821dff6bc 100644 --- a/plugins/Print.jsx +++ b/plugins/Print.jsx @@ -15,7 +15,6 @@ import FileSaver from 'file-saver'; import formDataEntries from 'formdata-json'; import JSZip from 'jszip'; import isEmpty from 'lodash.isempty'; -import {PDFDocument} from 'pdf-lib'; import PropTypes from 'prop-types'; import {setIdentifyEnabled} from '../actions/identify'; @@ -782,6 +781,7 @@ class Print extends React.Component { }); } async collectOnePdf(docs) { + const {PDFDocument} = await import('pdf-lib'); const mergedDoc = await PDFDocument.create(); for (const doc of docs) { const pdfBytes = await PDFDocument.load(doc.data);