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,12 +1,10 @@
const { PDFDocument, ParseSpeeds } = PDFLib;
export const scalePage = async (snapshot, page_size) => {
export async function scalePage(snapshot, pageSize, PDFLib) {
// Load the original PDF file
const pdfDoc = await PDFDocument.load(snapshot, {
parseSpeed: ParseSpeeds.Fastest,
const pdfDoc = await PDFLib.PDFDocument.load(snapshot, {
parseSpeed: PDFLib.ParseSpeeds.Fastest,
});
const new_size = page_size;
const new_size = pageSize;
const pages = pdfDoc.getPages();