From 87be41117fe3d1dc8d8629750b8c5fd8580abbdb Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com.> Date: Wed, 5 Jun 2024 21:16:22 +0100 Subject: [PATCH] tweaks and fix for #1381 --- build.gradle | 8 ++++---- .../docker-compose-latest-security-with-sso.yml | 2 +- exampleYmlFiles/docker-compose-latest-security.yml | 2 +- .../docker-compose-latest-ultra-lite-security.yml | 2 +- exampleYmlFiles/docker-compose-latest-ultra-lite.yml | 2 +- exampleYmlFiles/docker-compose-latest.yml | 2 +- .../SPDF/controller/api/strippers/PDFTableStripper.java | 1 - src/main/java/stirling/software/SPDF/utils/FileToPdf.java | 2 +- src/main/resources/templates/misc/flatten.html | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 0b3c26da..c247a2ba 100644 --- a/build.gradle +++ b/build.gradle @@ -172,14 +172,14 @@ dependencies { annotationProcessor 'org.projectlombok:lombok:1.18.32' } -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { dependsOn 'spotlessApply' } compileJava { options.compilerArgs << '-parameters' } -task writeVersion { +tasks.register('writeVersion') { def propsFile = file('src/main/resources/version.properties') def props = new Properties() props.setProperty('version', version) @@ -211,6 +211,6 @@ tasks.named('test') { useJUnitPlatform() } -task printVersion { - println project.version +tasks.register('printVersion') { + println project.version } diff --git a/exampleYmlFiles/docker-compose-latest-security-with-sso.yml b/exampleYmlFiles/docker-compose-latest-security-with-sso.yml index 592daeff..daf9fdc4 100644 --- a/exampleYmlFiles/docker-compose-latest-security-with-sso.yml +++ b/exampleYmlFiles/docker-compose-latest-security-with-sso.yml @@ -13,7 +13,7 @@ services: timeout: 10s retries: 16 ports: - - 8080:8080 + - "8080:8080" volumes: - /stirling/latest/data:/usr/share/tessdata:rw - /stirling/latest/config:/configs:rw diff --git a/exampleYmlFiles/docker-compose-latest-security.yml b/exampleYmlFiles/docker-compose-latest-security.yml index 82014b8e..b0ec6ea1 100644 --- a/exampleYmlFiles/docker-compose-latest-security.yml +++ b/exampleYmlFiles/docker-compose-latest-security.yml @@ -13,7 +13,7 @@ services: timeout: 10s retries: 16 ports: - - 8080:8080 + - "8080:8080" volumes: - /stirling/latest/data:/usr/share/tessdata:rw - /stirling/latest/config:/configs:rw diff --git a/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml b/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml index c0dd09ce..2faac865 100644 --- a/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml +++ b/exampleYmlFiles/docker-compose-latest-ultra-lite-security.yml @@ -13,7 +13,7 @@ services: timeout: 10s retries: 16 ports: - - 8080:8080 + - "8080:8080" volumes: - /stirling/latest/data:/usr/share/tessdata:rw - /stirling/latest/config:/configs:rw diff --git a/exampleYmlFiles/docker-compose-latest-ultra-lite.yml b/exampleYmlFiles/docker-compose-latest-ultra-lite.yml index 710c0072..da868ff2 100644 --- a/exampleYmlFiles/docker-compose-latest-ultra-lite.yml +++ b/exampleYmlFiles/docker-compose-latest-ultra-lite.yml @@ -13,7 +13,7 @@ services: timeout: 10s retries: 16 ports: - - 8080:8080 + - "8080:8080" volumes: - /stirling/latest/config:/configs:rw - /stirling/latest/logs:/logs:rw diff --git a/exampleYmlFiles/docker-compose-latest.yml b/exampleYmlFiles/docker-compose-latest.yml index c2593332..794eb1be 100644 --- a/exampleYmlFiles/docker-compose-latest.yml +++ b/exampleYmlFiles/docker-compose-latest.yml @@ -13,7 +13,7 @@ services: timeout: 10s retries: 16 ports: - - 8080:8080 + - "8080:8080" volumes: - /stirling/latest/data:/usr/share/tessdata:rw - /stirling/latest/config:/configs:rw diff --git a/src/main/java/stirling/software/SPDF/controller/api/strippers/PDFTableStripper.java b/src/main/java/stirling/software/SPDF/controller/api/strippers/PDFTableStripper.java index e2ed3ca0..0ea3e131 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/strippers/PDFTableStripper.java +++ b/src/main/java/stirling/software/SPDF/controller/api/strippers/PDFTableStripper.java @@ -117,7 +117,6 @@ public class PDFTableStripper extends PDFTextStripper { /** * Instantiate a new PDFTableStripper object. * - * @param document * @throws IOException If there is an error loading the properties. */ public PDFTableStripper() throws IOException { diff --git a/src/main/java/stirling/software/SPDF/utils/FileToPdf.java b/src/main/java/stirling/software/SPDF/utils/FileToPdf.java index da408a23..8448d288 100644 --- a/src/main/java/stirling/software/SPDF/utils/FileToPdf.java +++ b/src/main/java/stirling/software/SPDF/utils/FileToPdf.java @@ -52,7 +52,7 @@ public class FileToPdf { command.add("--paper-size"); command.add("a4"); - if (request.getZoom() != 1.0) { + if (request != null && request.getZoom() != 1.0) { // Create a temporary CSS file File tempCssFile = Files.createTempFile("customStyle", ".css").toFile(); try (FileWriter writer = new FileWriter(tempCssFile)) { diff --git a/src/main/resources/templates/misc/flatten.html b/src/main/resources/templates/misc/flatten.html index a5ca814e..956fae64 100644 --- a/src/main/resources/templates/misc/flatten.html +++ b/src/main/resources/templates/misc/flatten.html @@ -19,7 +19,7 @@
-
+