From 253b04ec0da0eb9fae287546297e3f1f0b58e30c Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Sun, 30 Nov 2025 13:37:38 +0100 Subject: [PATCH] Added Download Option for Drafts/Base64 --- components/PDFViewer.client.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/components/PDFViewer.client.vue b/components/PDFViewer.client.vue index 33e126a..2397391 100644 --- a/components/PDFViewer.client.vue +++ b/components/PDFViewer.client.vue @@ -127,7 +127,18 @@ const handleKeyPress = (event) => { const downloadControl = computed(() => vpvRef.value?.downloadControl) const handleDownloadFile = async () => { - await useFiles().downloadFile(props.fileId) + if(props.fileId){ + await useFiles().downloadFile(props.fileId) + } else if(props.uri){ + const a = document.createElement("a"); + a.href = props.uri; + a.download = "entwurf.pdf"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + } + + /*const downloadCtrl = unref(downloadControl) if (!downloadCtrl) return @@ -172,7 +183,7 @@ watch(downloadControl, (downloadCtrl) => { variant="outline" >