From 44f9313012bcdb0ea2331c9995eb2aceabd16fca Mon Sep 17 00:00:00 2001 From: foiv Date: Tue, 14 May 2024 12:11:30 +0300 Subject: [PATCH] Fix Rotation function --- src/main/resources/templates/rotate-pdf.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resources/templates/rotate-pdf.html b/src/main/resources/templates/rotate-pdf.html index 5446ff92..70e6bca5 100644 --- a/src/main/resources/templates/rotate-pdf.html +++ b/src/main/resources/templates/rotate-pdf.html @@ -55,7 +55,11 @@ console.log("loading pdf"); document.querySelector("#editSection").style.display = ""; - + + const existingPreview = document.getElementById("pdf-preview"); + if (existingPreview) { + existingPreview.remove(); + } var url = URL.createObjectURL(fileInput.files[0]) pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs/pdf.worker.js' const pdf = await pdfjsLib.getDocument(url).promise;