Removed duplicate code of node backend

Frontend traverser needs to be updated
This commit is contained in:
Felix Kaspar
2023-10-22 00:55:28 +02:00
parent b5ba2b25cd
commit 26cdb1d04f
19 changed files with 128 additions and 255 deletions

View File

@@ -1,11 +1,9 @@
const { PDFDocument, ParseSpeeds } = PDFLib;
export const mergePDFs = async (snapshots, PDFLib) => {
export const mergePDFs = async (snapshots) => {
const mergedPdf = await PDFDocument.create();
const mergedPdf = await PDFLib.PDFDocument.create();
for (let i = 0; i < snapshots.length; i++) {
const pdfToMerge = await PDFDocument.load(snapshots[i]);
const pdfToMerge = await PDFLib.PDFDocument.load(snapshots[i]);
const copiedPages = await mergedPdf.copyPages(pdfToMerge, pdfToMerge.getPageIndices());
copiedPages.forEach((page) => mergedPdf.addPage(page));