cleaned up node server

This commit is contained in:
Saud Fatayerji
2023-10-26 21:53:02 +03:00
parent 02f98fb378
commit 13c4f664c2
24 changed files with 181 additions and 1261 deletions

View File

@@ -1,3 +1,6 @@
import PDFLib from 'pdf-lib';
/**
* @typedef {"CUSTOM_PAGE_ORDER"|"REVERSE_ORDER"|"DUPLEX_SORT"|"BOOKLET_SORT"|"ODD_EVEN_SPLIT"|"REMOVE_FIRST"|"REMOVE_LAST"|"REMOVE_FIRST_AND_LAST"} OrderOperation
*/
@@ -10,7 +13,7 @@
* @param {import('pdf-lib')} PDFLib
* @returns
*/
export async function organizePages(snapshot, operation, customOrderString, PDFLib) {
export async function organizePages(snapshot, operation, customOrderString) {
const pdfDoc = await PDFLib.PDFDocument.load(snapshot);
let subDocument = await PDFLib.PDFDocument.create();
const copiedPages = await subDocument.copyPages(pdfDoc, pdfDoc.getPageIndices());