diff --git a/src/main/java/stirling/software/SPDF/controller/RotationController.java b/src/main/java/stirling/software/SPDF/controller/RotationController.java index 42676f6d..436dc484 100644 --- a/src/main/java/stirling/software/SPDF/controller/RotationController.java +++ b/src/main/java/stirling/software/SPDF/controller/RotationController.java @@ -37,7 +37,7 @@ public class RotationController { @PostMapping("/rotate-pdf") public ResponseEntity rotatePDF(@RequestParam("fileInput") MultipartFile pdfFile, - @RequestParam("angle") String angle) throws IOException { + @RequestParam("angle") Integer angle) throws IOException { // Load the PDF document PDDocument document = PDDocument.load(pdfFile.getBytes()); @@ -50,7 +50,7 @@ public class RotationController { while (iterPage.hasNext()) { PDPage page = iterPage.next(); - page.setRotation(Integer.valueOf(angle)); + page.setRotation(page.getRotation() + angle); } return PdfUtils.pdfDocToWebResponse(document, pdfFile.getName() + "_rotated.pdf"); diff --git a/src/main/resources/templates/fragments/common.html b/src/main/resources/templates/fragments/common.html index d8abe242..4340d5e8 100644 --- a/src/main/resources/templates/fragments/common.html +++ b/src/main/resources/templates/fragments/common.html @@ -6,6 +6,9 @@ + + + + + + +
+
+ + +
+
+ +
\ No newline at end of file diff --git a/src/main/resources/templates/rotate-pdf.html b/src/main/resources/templates/rotate-pdf.html index daa0e799..fb68049b 100644 --- a/src/main/resources/templates/rotate-pdf.html +++ b/src/main/resources/templates/rotate-pdf.html @@ -15,27 +15,32 @@

+
+
+ +
@@ -43,6 +48,84 @@
+ + + \ No newline at end of file