- 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:
@@ -2,8 +2,8 @@ import { ClassicPreset } from 'rete';
|
||||
import { BaseWorkflowNode } from './base-node';
|
||||
import { pdfSocket } from '../sockets';
|
||||
import type { PDFData, SocketData, MultiPDFData } from '../types';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import { loadPyMuPDF } from '../../utils/pymupdf-loader.js';
|
||||
import { loadPdfDocument } from '../../utils/load-pdf-document.js';
|
||||
|
||||
export class CbzToPdfNode extends BaseWorkflowNode {
|
||||
readonly category = 'Input' as const;
|
||||
@@ -55,7 +55,7 @@ export class CbzToPdfNode extends BaseWorkflowNode {
|
||||
for (const file of this.files) {
|
||||
const blob = await pymupdf.convertToPdf(file, { filetype: 'cbz' });
|
||||
const bytes = new Uint8Array(await blob.arrayBuffer());
|
||||
const document = await PDFDocument.load(bytes);
|
||||
const document = await loadPdfDocument(bytes);
|
||||
results.push({
|
||||
type: 'pdf',
|
||||
document,
|
||||
|
||||
Reference in New Issue
Block a user