Skip to content

Commit

Permalink
Dynamically import pdf-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Dec 20, 2024
1 parent 9983710 commit 9d717b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/Print.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9d717b1

Please sign in to comment.