- 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:
@@ -8,6 +8,7 @@ import {
|
||||
import { createIcons, icons } from 'lucide';
|
||||
import { PDFDocument as PDFLibDocument } from 'pdf-lib';
|
||||
import { loadPdfWithPasswordPrompt } from '../utils/password-prompt.js';
|
||||
import { loadPdfDocument } from '../utils/load-pdf-document.js';
|
||||
|
||||
const pageState: DividePagesState = {
|
||||
file: null,
|
||||
@@ -87,9 +88,7 @@ async function updateUI() {
|
||||
pageState.file = result.file;
|
||||
showLoader('Loading PDF...');
|
||||
|
||||
pageState.pdfDoc = await PDFLibDocument.load(result.bytes, {
|
||||
ignoreEncryption: true,
|
||||
});
|
||||
pageState.pdfDoc = await loadPdfDocument(result.bytes);
|
||||
pageState.totalPages = pageState.pdfDoc.getPageCount();
|
||||
hideLoader();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user