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
@@ -4,7 +4,7 @@ import { pdfSocket } from '../sockets';
import type { SocketData } from '../types';
import { requirePdfInput, processBatch } from '../types';
import { PDFDocument } from 'pdf-lib';
import * as pdfjsLib from 'pdfjs-dist';
import { getPDFDocument } from '../../utils/helpers.js';
import { wfError } from '../errors';
export class PosterizeNode extends BaseWorkflowNode {
@@ -45,8 +45,7 @@ export class PosterizeNode extends BaseWorkflowNode {
return {
pdf: await processBatch(pdfInputs, async (input) => {
const pdfjsDoc = await pdfjsLib.getDocument({ data: input.bytes })
.promise;
const pdfjsDoc = await getPDFDocument({ data: input.bytes }).promise;
const newDoc = await PDFDocument.create();
for (let i = 1; i <= pdfjsDoc.numPages; i++) {