From c060b2a4e0179a6ee203ed12f6f957e80654735a Mon Sep 17 00:00:00 2001 From: Saud Fatayerji Date: Sat, 18 Nov 2023 19:56:23 +0300 Subject: [PATCH] Fixed variable name --- shared-operations/src/functions/removeBlankPages.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-operations/src/functions/removeBlankPages.ts b/shared-operations/src/functions/removeBlankPages.ts index 2a5225b9..433df5c1 100644 --- a/shared-operations/src/functions/removeBlankPages.ts +++ b/shared-operations/src/functions/removeBlankPages.ts @@ -10,11 +10,12 @@ export type RemoveBlankPagesParamsType = { } export async function removeBlankPages(params: RemoveBlankPagesParamsType) { const { file, whiteThreashold } = params; - const pageCount = await file.pdfLibDocument; + const pdfDoc = await file.pdfLibDocument; + const pageCount = pdfDoc.getPageCount(); const emptyPages = await detectEmptyPages(file, whiteThreashold); console.debug("Empty Pages: ", emptyPages); - const pagesToKeep = invertSelection(emptyPages, pageCount.getPageCount()) + const pagesToKeep = invertSelection(emptyPages, pageCount) const newFile = await getPages(file, pagesToKeep); newFile.filename += "_removedBlanks"