mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-12 01:33:36 +01:00
- 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:
1 parent
9d362b1cf8
commit
9278774b8a
110 files changed
+1413
-1196
No files matched your search
@@ -3,8 +3,8 @@ import { BaseWorkflowNode } from './base-node';
|
||||
import { pdfSocket } from '../sockets';
|
||||
import type { SocketData } from '../types';
|
||||
import { requirePdfInput, processBatch } from '../types';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import { initializeQpdf } from '../../utils/helpers.js';
|
||||
import { loadPdfDocument } from '../../utils/load-pdf-document.js';
|
||||
|
||||
export class RepairNode extends BaseWorkflowNode {
|
||||
readonly category = 'Optimize & Repair' as const;
|
||||
@@ -49,8 +49,7 @@ export class RepairNode extends BaseWorkflowNode {
|
||||
}
|
||||
|
||||
const resultBytes = new Uint8Array(repairedData);
|
||||
const resultDoc = await PDFDocument.load(resultBytes, {
|
||||
ignoreEncryption: true,
|
||||
const resultDoc = await loadPdfDocument(resultBytes, {
|
||||
throwOnInvalidObject: false,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user