From b7d6107a2d6f688bf8a9010970102944a528762a Mon Sep 17 00:00:00 2001 From: sbplat <71648843+sbplat@users.noreply.github.com> Date: Sat, 23 Dec 2023 13:47:21 -0500 Subject: [PATCH 1/2] feat: add remove annotations --- .../SPDF/config/EndpointConfiguration.java | 1 + .../controller/web/OtherWebController.java | 8 ++- src/main/resources/messages_en_US.properties | 10 +++ src/main/resources/static/images/no-chat.svg | 6 ++ .../resources/templates/fragments/navbar.html | 3 +- src/main/resources/templates/home.html | 1 + .../templates/misc/remove-annotations.html | 64 +++++++++++++++++++ 7 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/static/images/no-chat.svg create mode 100644 src/main/resources/templates/misc/remove-annotations.html diff --git a/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java b/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java index 042fb07a6..ebba98155 100644 --- a/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java +++ b/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java @@ -124,6 +124,7 @@ public class EndpointConfiguration { addEndpointToGroup("Other", "flatten"); addEndpointToGroup("Other", "repair"); addEndpointToGroup("Other", "remove-blanks"); + addEndpointToGroup("Other", "remove-annotations"); addEndpointToGroup("Other", "compare"); addEndpointToGroup("Other", "add-page-numbers"); addEndpointToGroup("Other", "auto-rename"); diff --git a/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java b/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java index 8438b26dc..ce4ae6496 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java @@ -126,7 +126,13 @@ public class OtherWebController { model.addAttribute("currentPage", "remove-blanks"); return "misc/remove-blanks"; } - + + @GetMapping("/remove-annotations") + @Hidden + public String removeAnnotationsForm(Model model) { + model.addAttribute("currentPage", "remove-annotations"); + return "misc/remove-annotations"; + } @GetMapping("/auto-crop") @Hidden diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties index 32804afbb..1a73c4d4c 100644 --- a/src/main/resources/messages_en_US.properties +++ b/src/main/resources/messages_en_US.properties @@ -255,6 +255,10 @@ home.removeBlanks.title=Remove Blank pages home.removeBlanks.desc=Detects and removes blank pages from a document removeBlanks.tags=cleanup,streamline,non-content,organize +home.removeAnnotations.title=Remove Annotations +home.removeAnnotations.desc=Removes all comments/annotations from a PDF +removeAnnotations.tags=comments,highlight,notes,markup,remove + home.compare.title=Compare home.compare.desc=Compares and shows the differences between 2 PDF Documents compare.tags=differentiate,contrast,changes,analysis @@ -539,6 +543,12 @@ removeBlanks.whitePercentDesc=Percent of page that must be 'white' pixels to be removeBlanks.submit=Remove Blanks +#removeAnnotations +removeAnnotations.title=Remove Annotations +removeAnnotations.header=Remove Annotations +removeAnnotations.submit=Remove + + #compare compare.title=Compare compare.header=Compare PDFs diff --git a/src/main/resources/static/images/no-chat.svg b/src/main/resources/static/images/no-chat.svg new file mode 100644 index 000000000..8db220383 --- /dev/null +++ b/src/main/resources/static/images/no-chat.svg @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index 5b3d83cd2..315195489 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -107,7 +107,7 @@
-