From b5a59ddb6ae681c879d7298d122b64697b706a05 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Wed, 22 Mar 2023 19:24:43 +0000 Subject: [PATCH] compress fix --- build.gradle | 2 +- .../software/SPDF/controller/CompressController.java | 2 ++ src/main/resources/messages_ar_AR.properties | 11 +++++++++-- src/main/resources/messages_de_DE.properties | 9 ++++++++- src/main/resources/messages_en_US.properties | 9 ++++++++- src/main/resources/messages_fr_FR.properties | 9 ++++++++- 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 1614c48b..ae51be50 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'stirling.software' -version = '0.4.0' +version = '0.4.1' sourceCompatibility = '17' repositories { diff --git a/src/main/java/stirling/software/SPDF/controller/CompressController.java b/src/main/java/stirling/software/SPDF/controller/CompressController.java index c2c40c2f..6e72b09c 100644 --- a/src/main/java/stirling/software/SPDF/controller/CompressController.java +++ b/src/main/java/stirling/software/SPDF/controller/CompressController.java @@ -80,6 +80,8 @@ public class CompressController { // Prepare the OCRmyPDF command List command = new ArrayList<>(); command.add("ocrmypdf"); + command.add("--skip-text"); + command.add("--tesseract-timeout=0"); command.add("--optimize"); command.add(String.valueOf(optimizeLevel)); diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index 6ad6d0a1..9e66580c 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -127,8 +127,15 @@ addImage.submit=إضافة صورة #compress compress.title=ضغط -compress.header=ضغط ملف PDF -compress.compressLevel=القيمة بين 1 و 100 (يتم تقليل 1 إلى أقصى حد) +compress.header=\u0636\u063A\u0637 PDF +compress.credit=\u062A\u0633\u062A\u062E\u062F\u0645 \u0647\u0630\u0647 \u0627\u0644\u062E\u062F\u0645\u0629 OCRmyPDF \u0644\u0636\u063A\u0637 / \u062A\u062D\u0633\u064A\u0646 PDF. +compress.selectText.1 = \u0645\u0633\u062A\u0648\u0649 \u0627\u0644\u062A\u062D\u0633\u064A\u0646: +compress.selectText.2=0 (\u0628\u062F\u0648\u0646 \u062A\u062D\u0633\u064A\u0646) +compress.selectText.3=1 (\u0627\u0641\u062A\u0631\u0627\u0636\u064A\u060C \u062A\u062D\u0633\u064A\u0646 \u0628\u062F\u0648\u0646 \u0641\u0642\u062F\u0627\u0646) +compress.selectText.4=2 (\u062A\u062D\u0633\u064A\u0646 \u0636\u064A\u0627\u0639) +compress.selectText.5=3 (\u062A\u062D\u0633\u064A\u0646 \u0636\u064A\u0627\u0639 \u060C \u0623\u0643\u062B\u0631 \u0639\u062F\u0648\u0627\u0646\u064A\u0629) +compress.selectText.6=\u062A\u0645\u0643\u064A\u0646 \u0639\u0631\u0636 \u0627\u0644\u0648\u064A\u0628 \u0627\u0644\u0633\u0631\u064A\u0639 (\u062E\u0637\u064A PDF) +compress.selectText.7=\u062A\u0645\u0643\u064A\u0646 \u062A\u0631\u0645\u064A\u0632 JBIG2 \u0627\u0644\u0645\u0641\u0642\u0648\u062F compress.submit=ضغط diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index f4d1b974..28daca8c 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -127,7 +127,14 @@ addImage.submit=Bild hinzufügen #compress compress.title=Komprimieren compress.header=PDF komprimieren -compress.compressLevel=Wert zwischen 1 und 100 (1 ist am meisten komprimiert) +compress.credit=Dieser Dienst verwendet OCRmyPDF fr die PDF-Komprimierung/-Optimierung. +compress.selectText.1=Optimierungsstufe: +compress.selectText.2=0 (Keine Optimierung) +compress.selectText.3=1 (Standard, verlustfreie Optimierung) +compress.selectText.4=2 (Verlustbehaftete Optimierung) +compress.selectText.5=3 (Verlustbehaftete Optimierung, aggressiver) +compress.selectText.6=Schnelle Webansicht aktivieren (PDF linearisieren) +compress.selectText.7=Verlustbehaftete JBIG2-Kodierung aktivieren compress.submit=Komprimieren diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties index e3f01109..77a76514 100644 --- a/src/main/resources/messages_en_US.properties +++ b/src/main/resources/messages_en_US.properties @@ -124,7 +124,14 @@ addImage.submit=Add image #compress compress.title=Compress compress.header=Compress PDF -compress.compressLevel=Value between 1 and 100 (1 being most reduced) +compress.credit=This service uses OCRmyPDF for PDF Compress/Optimisation. +compress.selectText.1=Optimization level: +compress.selectText.2=0 (No optimization) +compress.selectText.3=1 (Default, lossless optimization) +compress.selectText.4=2 (Lossy optimization) +compress.selectText.5=3 (Lossy optimization, more aggressive) +compress.selectText.6=Enable fast web view (linearize PDF) +compress.selectText.7=Enable lossy JBIG2 encoding compress.submit=Compress diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index 05788282..b26d7229 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -133,7 +133,14 @@ addImage.submit=Ajouter une image #compress compress.title=Compresser compress.header=Compresser le PDF -compress.compressLevel=Valeur entre 1 et 100 (1 étant le plus réduit) +compress.credit=Ce service utilise OCRmyPDF pour la compression/optimisation PDF. +compress.selectText.1=Niveau d\u2019optimisation : +compress.selectText.2=0 (pas d\u2019optimisation) +compress.selectText.3=1 (par dfaut, optimisation sans perte) +compress.selectText.4=2 (optimisation avec perte) +compress.selectText.5=3 (optimisation avec perte, plus agressive) +compress.selectText.6=Activer l\u2019affichage Web rapide (linariser PDF) +compress.selectText.7=Activer l\u2019encodage JBIG2 avec perte compress.submit=Compresser