From 963c1f4874d8b99f479fa079785cc2432ef3ed6d Mon Sep 17 00:00:00 2001 From: foiv Date: Sat, 1 Jun 2024 13:58:56 +0300 Subject: [PATCH] fix the crop problem --- src/main/resources/templates/crop.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/crop.html b/src/main/resources/templates/crop.html index 1f3d9734..1547a51f 100644 --- a/src/main/resources/templates/crop.html +++ b/src/main/resources/templates/crop.html @@ -1,7 +1,7 @@ - + @@ -75,6 +75,16 @@ } }); + cropForm.addEventListener('submit', function(e) { + if (xInput.value == "" && yInput.value == "" && widthInput.value == "" && heightInput.value == "") { + // Ορίστε συντεταγμένες για ολόκληρη την επιφάνεια του PDF + xInput.value = 0; + yInput.value = 0; + widthInput.value = pdfCanvas.width; + heightInput.value = pdfCanvas.height; + } + }); + overlayCanvas.addEventListener('mousedown', function(e) { // Clear previously drawn rectangle on the main canvas context.clearRect(0, 0, pdfCanvas.width, pdfCanvas.height); @@ -138,4 +148,4 @@ - \ No newline at end of file +