- Refactor PDF loading across workflow nodes to use loadPdfDocument utility

- Replaced direct calls to PDFDocument.load with loadPdfDocument in multiple nodes to standardize PDF loading process.
This commit is contained in:
alam00000 committed 2026-03-26 13:40:21 +05:30
1 parent 9d362b1cf8
commit 9278774b8a
110 files changed
+1413 -1196

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ import { pdfSocket } from '../sockets';
import type { SocketData } from '../types';
import { extractAllPdfs } from '../types';
import { mergePdfs } from '../../utils/pdf-operations';
import { PDFDocument } from 'pdf-lib';
import { loadPdfDocument } from '../../utils/load-pdf-document.js';
export class MergeNode extends BaseWorkflowNode {
readonly category = 'Organize & Manage' as const;
@@ -26,7 +26,7 @@ export class MergeNode extends BaseWorkflowNode {
throw new Error('No PDFs connected to Merge node');
const mergedBytes = await mergePdfs(allPdfs.map((p) => p.bytes));
const mergedDoc = await PDFDocument.load(mergedBytes);
const mergedDoc = await loadPdfDocument(mergedBytes);
return {
pdf: {