From f6c4f08254b699ae798269c65d9b61e1aff5c4ab Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Thu, 14 Sep 2023 13:32:49 +0100 Subject: [PATCH] docs --- HowToAddNewLanguage.md | 4 +- README.md | 97 ++++++++++++------- .../SPDF/config/CleanUrlInterceptor.java | 1 - src/main/resources/application.properties | 8 ++ src/main/resources/templates/account.html | 2 +- .../resources/templates/change-creds.html | 22 ++++- 6 files changed, 93 insertions(+), 41 deletions(-) diff --git a/HowToAddNewLanguage.md b/HowToAddNewLanguage.md index 26a398bf..b6a7fa4a 100644 --- a/HowToAddNewLanguage.md +++ b/HowToAddNewLanguage.md @@ -8,7 +8,7 @@ Fork Stirling-PDF and make a new branch out of Main Then add reference to the language in the navbar by adding a new language entry to the dropdown -https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/templates/fragments/navbar.html#L306 +https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/templates/fragments/languages.html and add a flag svg file to https://github.com/Frooodle/Stirling-PDF/tree/main/src/main/resources/static/images/flags Any SVG flags are fine, i got most of mine from [here](https://flagicons.lipis.dev/) @@ -25,7 +25,7 @@ The data-language-code is the code used to reference the file in the next step. Start by copying the existing english property file -[https://github.com/Frooodle/Stirling-PDF/tree/langSetup/src/main/resources/messages_en_GB.properties](https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/messages_en_US.properties) +[https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/messages_en_GB.properties](https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/messages_en_GB.properties) Copy and rename it to messages_{your data-language-code here}.properties, in the polish example you would set the name to messages_pl_PL.properties diff --git a/README.md b/README.md index a034eaf2..d0bb6bcc 100644 --- a/README.md +++ b/README.md @@ -21,45 +21,64 @@ Feel free to request any features or bug fixes either in github issues or our [D ![stirling-home](images/stirling-home.png) +## **PDF Features** -## Features -- Full interactive GUI for merging/splitting/rotating/moving PDFs and their pages. -- Split PDFs into multiple files at specified page numbers or extract all pages as individual files. -- Merge multiple PDFs together into a single resultant file -- Convert PDFs to and from images -- Reorganize PDF pages into different orders. -- Add/Generate signatures -- Format PDFs into a multi-paged page -- Scale page contents size by set % -- Adjust Contrast -- Crop PDF -- Auto Split PDF (With physically scanned page dividers) -- Flatten PDFs -- Repair PDFs -- Detect and remove blank pages -- Compare 2 PDFs and show differences in text -- Add images to PDFs -- Rotating PDFs in 90 degree increments. -- Compressing PDFs to decrease their filesize. (Using OCRMyPDF) -- Add and remove passwords -- Set PDF Permissions -- Add watermark(s) -- Convert Any common file to PDF (using LibreOffice) -- Convert PDF to Word/Powerpoint/Others (using LibreOffice) -- Convert HTML to PDF -- URL to PDF -- Extract images from PDF -- Extract images from Scans -- Add page numbers -- Auto rename file by detecting PDF header text -- OCR on PDF (Using OCRMyPDF) -- PDF/A conversion (Using OCRMyPDF) -- Edit metadata +### **Page Operations** +- Full interactive GUI for merging/splitting/rotating/moving PDFs and their pages. +- Merge multiple PDFs together into a single resultant file. +- Split PDFs into multiple files at specified page numbers or extract all pages as individual files. +- Reorganize PDF pages into different orders. +- Rotate PDFs in 90-degree increments. +- Remove pages. +- Multi-page layout (Format PDFs into a multi-paged page). +- Scale page contents size by set %. +- Adjust Contrast. +- Crop PDF. +- Auto Split PDF (With physically scanned page dividers). +- Extract page(s). +- Convert PDF to a single page. + +### **Conversion Operations** +- Convert PDFs to and from images. +- Convert any common file to PDF (using LibreOffice). +- Convert PDF to Word/Powerpoint/Others (using LibreOffice). +- Convert HTML to PDF. +- URL to PDF. +- Markdown to PDF. + +### **Security & Permissions** +- Add and remove passwords. +- Change/set PDF Permissions. +- Add watermark(s). +- Certify/sign PDFs. +- Sanitize PDFs. +- Auto-redact text. + +### **Other Operations** +- Add/Generate/Write signatures. +- Repair PDFs. +- Detect and remove blank pages. +- Compare 2 PDFs and show differences in text. +- Add images to PDFs. +- Compress PDFs to decrease their filesize (Using OCRMyPDF). +- Extract images from PDF. +- Extract images from Scans. +- Add page numbers. +- Auto rename file by detecting PDF header text. +- OCR on PDF (Using OCRMyPDF). +- PDF/A conversion (Using OCRMyPDF). +- Edit metadata. +- Flatten PDFs. +- Get all information on a PDF to view or export as JSON. + +## Extra Features - Dark mode support. - Custom download options (see [here](https://github.com/Frooodle/Stirling-PDF/blob/main/images/settings.png) for example) - Parallel file processing and downloads - API for integration with external scripts + + For a overview of the tasks and the technology each uses please view [groups.md](https://github.com/Frooodle/Stirling-PDF/blob/main/Groups.md) Hosted instance/demo of the app can be seen [here](https://pdf.adminforge.de/) hosted by the team at adminforge.de @@ -94,6 +113,7 @@ docker run -d \ -p 8080:8080 \ -v /location/of/trainingData:/usr/share/tesseract-ocr/4.00/tessdata \ -v /location/of/extraConfigs:/configs \ + -e DOCKER_ENABLE_SECURITY=false \ --name stirling-pdf \ frooodle/s-pdf:latest @@ -114,6 +134,11 @@ services: - /location/of/trainingData:/usr/share/tesseract-ocr/4.00/tessdata #Required for extra OCR languages - /location/of/extraConfigs:/configs # - /location/of/customFiles:/customFiles/ + environment: + - DOCKER_ENABLE_SECURITY=false + + + ``` @@ -122,8 +147,9 @@ services: Please view https://github.com/Frooodle/Stirling-PDF/blob/main/HowToUseOCR.md ## Want to add your own language? -Stirling PDF currently supports 16! +Stirling PDF currently supports 18! - English (English) (en_GB) +- English (US) (en_US) - Arabic (العربية) (ar_AR) - German (Deutsch) (de_DE) - French (Français) (fr_FR) @@ -139,6 +165,7 @@ Stirling PDF currently supports 16! - Russian (Русский) (ru_RU) - Basque (Euskara) (eu_ES) - Japanese (日本語) (ja_JP) +- Dutch (Nederlands) (nl_NL) If you want to add your own language to Stirling-PDF please refer https://github.com/Frooodle/Stirling-PDF/blob/main/HowToAddNewLanguage.md @@ -190,7 +217,7 @@ endpoints: groupsToRemove: [] # List groups to disable (e.g. ['LibreOffice']) metrics: - enabled: true # 'true' to enable Info APIs (`/api/*`) endpoints, 'false' to disable + enabled: true # 'true' to enable Info APIs endpoints (view http://localhost:8080/swagger-ui/index.html#/API to learn more), 'false' to disable ``` ### Extra notes - Endpoints. Currently, the endpoints ENDPOINTS_TO_REMOVE and GROUPS_TO_REMOVE can include comma separate lists of endpoints and groups to disable as example ENDPOINTS_TO_REMOVE=img-to-pdf,remove-pages would disable both image-to-pdf and remove pages, GROUPS_TO_REMOVE=LibreOffice Would disable all things that use LibreOffice. You can see a list of all endpoints and groups [here](https://github.com/Frooodle/Stirling-PDF/blob/main/groups.md) diff --git a/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java b/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java index 4df14253..894d50d8 100644 --- a/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java +++ b/src/main/java/stirling/software/SPDF/config/CleanUrlInterceptor.java @@ -22,7 +22,6 @@ public class CleanUrlInterceptor implements HandlerInterceptor { String queryString = request.getQueryString(); if (queryString != null && !queryString.isEmpty()) { String requestURI = request.getRequestURI(); - Map parameters = new HashMap<>(); // Keep only the allowed parameters diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f5643af8..f8cfc519 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -37,3 +37,11 @@ spring.datasource.username=sa spring.datasource.password= spring.h2.console.enabled=true spring.jpa.hibernate.ddl-auto=update + +# Change the default URL path for OpenAPI JSON +springdoc.api-docs.path=/v1/api-docs + +# Set the URL of the OpenAPI JSON for the Swagger UI +springdoc.swagger-ui.url=/v1/api-docs + + diff --git a/src/main/resources/templates/account.html b/src/main/resources/templates/account.html index b7beed7f..3111c1f0 100644 --- a/src/main/resources/templates/account.html +++ b/src/main/resources/templates/account.html @@ -175,7 +175,7 @@ document.addEventListener("DOMContentLoaded", function() { - const form = document.querySelector('form[action="/change-password"]'); + const form = document.querySelector('form[action="api/v1/user/change-password"]'); form.addEventListener('submit', function(event) { const newPassword = document.getElementById('newPassword').value; diff --git a/src/main/resources/templates/change-creds.html b/src/main/resources/templates/change-creds.html index 5c62fe1d..94b87b64 100644 --- a/src/main/resources/templates/change-creds.html +++ b/src/main/resources/templates/change-creds.html @@ -37,7 +37,7 @@

Change Username and password

-
+
@@ -50,12 +50,30 @@
+
+ + +
- +