diff --git a/public/app.js b/public/app.js index 59ae8fe..1151163 100644 --- a/public/app.js +++ b/public/app.js @@ -8,6 +8,7 @@ const resultTitle = document.querySelector('#resultTitle'); const connectionStatus = document.querySelector('#connectionStatus'); const previewFrame = document.querySelector('#previewFrame'); const previewLoading = document.querySelector('#previewLoading'); +const previewOpenBtn = document.querySelector('#previewOpenBtn'); let currentPdfBlob = null; let currentPdfFileName = '租屋契約.pdf'; @@ -168,6 +169,8 @@ async function loadPreview() { if (previewBlobUrl) URL.revokeObjectURL(previewBlobUrl); previewBlobUrl = URL.createObjectURL(blob); previewFrame.src = `${previewBlobUrl}#toolbar=0`; + previewOpenBtn.href = previewBlobUrl; + previewOpenBtn.hidden = false; } catch { // AbortError 或其他錯誤都忽略,交給 finally 處理 } finally { diff --git a/public/index.html b/public/index.html index 08d2cdc..7a4829b 100644 --- a/public/index.html +++ b/public/index.html @@ -81,7 +81,10 @@
Word 預覽
+Word 預覽
+ 開新分頁 +