fix(workflow): pass wasmUrl to pdf.js so JPEG2000 pages stop rendering blank, and fix Remove Blank Pages node failing on every PDF

This commit is contained in:
alam00000 committed 2026-11-08 22:52:12 +05:30
1 parent ed197274e9
commit f0a1868526
12 files changed
+24 -31

No files matched your search

+2 -3
View File
@@ -5,7 +5,7 @@ import type { SocketData } from '../types';
import { requirePdfInput, processBatch } from '../types';
import { applyScannerEffect } from '../../utils/image-effects';
import { PDFDocument } from 'pdf-lib';
import * as pdfjsLib from 'pdfjs-dist';
import { getPDFDocument } from '../../utils/helpers.js';
import type { ScanSettings } from '../../types/scanner-effect-type';
import { wfError } from '../errors';
@@ -95,8 +95,7 @@ export class ScannerEffectNode extends BaseWorkflowNode {
return {
pdf: await processBatch(pdfInputs, async (input) => {
const newPdfDoc = await PDFDocument.create();
const pdfjsDoc = await pdfjsLib.getDocument({ data: input.bytes })
.promise;
const pdfjsDoc = await getPDFDocument({ data: input.bytes }).promise;
const dpiScale = settings.resolution / 72;
for (let i = 1; i <= pdfjsDoc.numPages; i++) {