- 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

@@ -15,6 +15,7 @@ import {
import { downloadFile } from '../../utils/helpers.ts';
import { computeComparisonForPair } from '../../logic/compare-render.ts';
import { LRUCache } from '../lru-cache.ts';
import { loadPdfDocument } from '../../utils/load-pdf-document.js';
const HIGHLIGHT_COLORS: Record<
string,
@@ -112,8 +113,8 @@ export async function exportComparePdf(
]);
const [libDoc1, libDoc2] = await Promise.all([
bytes1 ? PDFDocument.load(bytes1, { ignoreEncryption: true }) : null,
bytes2 ? PDFDocument.load(bytes2, { ignoreEncryption: true }) : null,
bytes1 ? loadPdfDocument(bytes1, { ignoreEncryption: true }) : null,
bytes2 ? loadPdfDocument(bytes2, { ignoreEncryption: true }) : null,
]);
const includeChange = options?.includeChange ?? (() => true);