feat: add JSON to PDF and PDF to JSON conversion tools

- Introduced new pages and logic for converting JSON files to PDF and vice versa.
- Implemented web workers for handling conversion processes in the background.
- Updated Vite configuration to include new HTML pages for the conversion tools.
- Enhanced user interface with file upload sections and status messages for conversion progress.
- Added TypeScript definitions for worker communication and response handling.
This commit is contained in:
abdullahalam123
2025-11-08 15:19:56 +05:30
parent 5b7c09ddf3
commit 0999163d3c
11 changed files with 706 additions and 27 deletions

20
public/workers/json-to-pdf.worker.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
declare const coherentpdf: typeof import('../../src/types/coherentpdf.global').coherentpdf;
interface ConvertJSONToPDFMessage {
command: 'convert';
fileBuffers: ArrayBuffer[];
fileNames: string[];
}
interface JSONToPDFSuccessResponse {
status: 'success';
pdfFiles: Array<{ name: string; data: ArrayBuffer }>;
}
interface JSONToPDFErrorResponse {
status: 'error';
message: string;
}
type JSONToPDFResponse = JSONToPDFSuccessResponse | JSONToPDFErrorResponse;