- 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
2026-03-26 13:40:21 +05:30
parent 9d362b1cf8
commit 9278774b8a
110 changed files with 1413 additions and 1196 deletions

View File

@@ -49,6 +49,7 @@ import {
PageData,
} from '@/types';
import { extractExistingFields as extractExistingPdfFields } from './form-creator-extraction.js';
import { loadPdfDocument } from '../utils/load-pdf-document.js';
let fields: FormField[] = [];
let selectedField: FormField | null = null;
@@ -3140,9 +3141,7 @@ async function handlePdfUpload(file: File) {
if (!result) return;
const arrayBuffer = result.bytes;
uploadedPdfjsDoc = result.pdf;
uploadedPdfDoc = await PDFDocument.load(arrayBuffer, {
ignoreEncryption: true,
});
uploadedPdfDoc = await loadPdfDocument(arrayBuffer);
// Check for existing fields and update counter
existingFieldNames.clear();