diff --git a/build.gradle b/build.gradle index 0afc366b..bf19d3c6 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'stirling.software' -version = '0.11.0' +version = '0.11.1' sourceCompatibility = '17' repositories { diff --git a/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java b/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java index dcf953a5..8290f76b 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/GeneralWebController.java @@ -2,7 +2,12 @@ package stirling.software.SPDF.controller.web; import java.io.File; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; import java.nio.charset.StandardCharsets; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -124,17 +129,46 @@ public class GeneralWebController { return "sign"; } private List getFontNames() { + List fontNames = new ArrayList<>(); + try { - return Files.list(Paths.get("src/main/resources/static/fonts")) - .map(Path::getFileName) - .map(Path::toString) + // Get the directory URL from classpath + URL dirURL = getClass().getClassLoader().getResource("static/fonts"); + + if (dirURL != null && dirURL.getProtocol().equals("file")) { + // If running from the file system (e.g., IDE) + fontNames.addAll( + Files.list(Paths.get(dirURL.toURI())) + .map(java.nio.file.Path::getFileName) + .map(java.nio.file.Path::toString) + .filter(name -> name.endsWith(".woff2")) + .map(name -> name.substring(0, name.length() - 6)) // Remove .woff2 extension + .collect(Collectors.toList()) + ); + } else { + // If running from a JAR file + // Resources in JAR go through a different URL protocol. + // In this case, we'll use a different approach to list them. + + // Create a link to the resource. This assumes resources are at the root of the JAR. + URI uri = getClass().getResource("/").toURI(); + FileSystem fileSystem = FileSystems.newFileSystem(uri, new HashMap<>()); + Path myPath = fileSystem.getPath("/static/fonts/"); + Files.walk(myPath, 1) + .filter(path -> !Files.isDirectory(path)) + .map(path -> path.getFileName().toString()) .filter(name -> name.endsWith(".woff2")) .map(name -> name.substring(0, name.length() - 6)) // Remove .woff2 extension - .collect(Collectors.toList()); - } catch (IOException e) { + .forEach(fontNames::add); + fileSystem.close(); + } + } catch (IOException | URISyntaxException e) { throw new RuntimeException("Failed to read font directory", e); } + + return fontNames; } + @GetMapping("/crop") diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index 9f3d30c6..96a53cec 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_ca_CA.properties b/src/main/resources/messages_ca_CA.properties index fb29aa6b..bec93536 100644 --- a/src/main/resources/messages_ca_CA.properties +++ b/src/main/resources/messages_ca_CA.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index 04f31beb..1ed74f91 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index e18ee264..0d881b65 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -309,6 +309,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_es_ES.properties b/src/main/resources/messages_es_ES.properties index 56e92fdb..4e87240f 100644 --- a/src/main/resources/messages_es_ES.properties +++ b/src/main/resources/messages_es_ES.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_eu_ES.properties b/src/main/resources/messages_eu_ES.properties index 1149b8ca..96db8581 100644 --- a/src/main/resources/messages_eu_ES.properties +++ b/src/main/resources/messages_eu_ES.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index b5e67732..86eb1fc6 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index 25a5bc82..e8d706b0 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_ja_JP.properties b/src/main/resources/messages_ja_JP.properties index ac20e9ec..fe6086e7 100644 --- a/src/main/resources/messages_ja_JP.properties +++ b/src/main/resources/messages_ja_JP.properties @@ -462,6 +462,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_ko_KR.properties b/src/main/resources/messages_ko_KR.properties index 956aad6d..cd01f417 100644 --- a/src/main/resources/messages_ko_KR.properties +++ b/src/main/resources/messages_ko_KR.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_pl_PL.properties b/src/main/resources/messages_pl_PL.properties index 7c78541c..7ea64167 100644 --- a/src/main/resources/messages_pl_PL.properties +++ b/src/main/resources/messages_pl_PL.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_pt_BR.properties b/src/main/resources/messages_pt_BR.properties index f6e4cda1..3b98b0e6 100644 --- a/src/main/resources/messages_pt_BR.properties +++ b/src/main/resources/messages_pt_BR.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_ro_RO.properties b/src/main/resources/messages_ro_RO.properties index e28e9d8d..e66a6fc5 100644 --- a/src/main/resources/messages_ro_RO.properties +++ b/src/main/resources/messages_ro_RO.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_ru_RU.properties b/src/main/resources/messages_ru_RU.properties index 5b509f46..28b0a1e7 100644 --- a/src/main/resources/messages_ru_RU.properties +++ b/src/main/resources/messages_ru_RU.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_sv_SE.properties b/src/main/resources/messages_sv_SE.properties index d8552725..0e833124 100644 --- a/src/main/resources/messages_sv_SE.properties +++ b/src/main/resources/messages_sv_SE.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/messages_zh_CN.properties b/src/main/resources/messages_zh_CN.properties index 447a4ec4..d1b3b578 100644 --- a/src/main/resources/messages_zh_CN.properties +++ b/src/main/resources/messages_zh_CN.properties @@ -429,6 +429,7 @@ autoSplitPDF.selectText.2=Scan all your documents at once by inserting the divid autoSplitPDF.selectText.3=Upload the single large scanned PDF file and let Stirling PDF handle the rest. autoSplitPDF.selectText.4=Divider pages are automatically detected and removed, guaranteeing a neat final document. autoSplitPDF.formPrompt=Submit PDF containing Stirling-PDF Page dividers: +autoSplitPDF.duplexMode=Duplex Mode (Front and back scanning) autoSplitPDF.dividerDownload1=Download 'Auto Splitter Divider (minimal).pdf' autoSplitPDF.dividerDownload2=Download 'Auto Splitter Divider (with instructions).pdf' autoSplitPDF.submit=Submit diff --git a/src/main/resources/templates/convert/pdf-to-html.html b/src/main/resources/templates/convert/pdf-to-html.html index 16e0a39b..4e28471c 100644 --- a/src/main/resources/templates/convert/pdf-to-html.html +++ b/src/main/resources/templates/convert/pdf-to-html.html @@ -1,7 +1,7 @@ - +
@@ -11,14 +11,14 @@
-

-
+

+

- +
-

+