mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-11 17:23:37 +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
@@ -1,6 +1,7 @@
|
||||
import { PDFDocument, PDFName } from 'pdf-lib';
|
||||
import { createIcons, icons } from 'lucide';
|
||||
import { loadPdfWithPasswordPrompt } from '../utils/password-prompt.js';
|
||||
import { loadPdfDocument } from '../utils/load-pdf-document.js';
|
||||
|
||||
// State management
|
||||
const pageState: { pdfDoc: PDFDocument | null; file: File | null } = {
|
||||
@@ -108,9 +109,7 @@ async function handleFileUpload(file: File) {
|
||||
if (!result) return;
|
||||
showLoader('Loading PDF...');
|
||||
result.pdf.destroy();
|
||||
pageState.pdfDoc = await PDFDocument.load(result.bytes, {
|
||||
ignoreEncryption: true,
|
||||
});
|
||||
pageState.pdfDoc = await loadPdfDocument(result.bytes);
|
||||
pageState.file = result.file;
|
||||
updateFileDisplay();
|
||||
document.getElementById('options-panel')?.classList.remove('hidden');
|
||||
|
||||
Reference in new issue
Block a user