- 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:
alam00000
2026-03-26 13:40:21 +05:30
parent 9d362b1cf8
commit 9278774b8a
110 changed files with 1413 additions and 1196 deletions

View File

@@ -1,6 +1,22 @@
import { PDFDocument } from 'pdf-lib';
export interface PageDimensionsState {
file: File | null;
pdfDoc: PDFDocument | null;
file: File | null;
pdfDoc: PDFDocument | null;
}
export interface AnalyzedPageData {
pageNum: number;
width: number;
height: number;
orientation: string;
standardSize: string;
rotation: number;
}
export interface UniqueSizeEntry {
count: number;
label: string;
width: number;
height: number;
}

View File

@@ -1,5 +1,32 @@
import { PDFDocument } from 'pdf-lib';
export interface SignPdfState {
file: File | null;
pdfBytes: ArrayBuffer | null;
signatureData: string | null;
file: File | null;
pdfBytes: ArrayBuffer | null;
signatureData: string | null;
}
export interface PDFViewerEventBus {
_on: (event: string, callback: () => void) => void;
dispatch: (event: string, data: Record<string, unknown>) => void;
}
export interface PDFViewerApplication {
eventBus?: PDFViewerEventBus;
pdfDocument?: {
saveDocument: (storage: unknown) => Promise<ArrayBuffer>;
annotationStorage: unknown;
};
}
export interface PDFViewerWindow extends Window {
PDFViewerApplication?: PDFViewerApplication;
}
export interface SignState {
file: File | null;
pdfDoc: PDFDocument | null;
viewerIframe: HTMLIFrameElement | null;
viewerReady: boolean;
blobUrl: string | null;
}