mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-13 01:54:00 +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,4 +1,5 @@
|
||||
import { PDFDocument, PDFName } from 'pdf-lib';
|
||||
import { loadPdfDocument } from './load-pdf-document.js';
|
||||
|
||||
export interface SanitizeOptions {
|
||||
flattenForms: boolean;
|
||||
@@ -503,7 +504,7 @@ export async function sanitizePdf(
|
||||
pdfBytes: Uint8Array,
|
||||
options: SanitizeOptions
|
||||
): Promise<{ pdfDoc: PDFDocument; bytes: Uint8Array }> {
|
||||
const pdfDoc = await PDFDocument.load(pdfBytes);
|
||||
const pdfDoc = await loadPdfDocument(pdfBytes);
|
||||
|
||||
if (options.flattenForms) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user