Update Signature App.vue to use a converted pdf

Introduced a new helper ts function to download documents as PDFs and integrated with the existing workflow. Enhanced `PDFSignatureZoneAvailable` to implement `LocaleAwareInterface` for better locale management and added PDF conversion handling for non-PDF documents. Updated App.vue to use the new PDF download method.
This commit is contained in:
2024-11-15 14:17:26 +01:00
parent a312b45777
commit 03fe9a6d86
4 changed files with 55 additions and 8 deletions

View File

@@ -277,7 +277,7 @@ console.log(PdfWorker); // incredible but this is needed
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
import { download_and_decrypt_doc } from "../StoredObjectButton/helpers";
import {download_and_decrypt_doc, download_doc_as_pdf} from "../StoredObjectButton/helpers";
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
@@ -385,10 +385,7 @@ const init = () => downloadAndOpen().then(initPdf);
async function downloadAndOpen(): Promise<Blob> {
let raw;
try {
raw = await download_and_decrypt_doc(
signature.storedObject,
signature.storedObject.currentVersion
);
raw = await download_doc_as_pdf(signature.storedObject);
} catch (e) {
console.error("error while downloading and decrypting document", e);
throw e;