diff --git a/launcher.bat b/launcher.bat index e427669..5a65c6d 100644 --- a/launcher.bat +++ b/launcher.bat @@ -1 +1,5 @@ -java -Dfile.encoding=UTF-8 -classpath /Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/bin:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-beanutils-1.9.2.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-io-2.6.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-logging-1.2-javadoc.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-logging-1.2.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/fontbox-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/fontbox-2.0.9.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/ghost4j-1.0.1.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/hamcrest-core-1.3.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/itext-2.1.7.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jai-imageio-core-1.4.0.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jbig2-imageio-3.0.0.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jboss-vfs-3.2.12.Final.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jcl-over-slf4j-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jna-4.1.0.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jul-to-slf4j-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/junit-4.12.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/lept4j-1.6.4.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/log4j-api-2.12.1.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/log4j-core-2.12.1.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/log4j-over-slf4j-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/logback-classic-1.2.3.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/logback-core-1.2.3.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-2.0.9.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-app-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-debugger-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-tools-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-tools-2.0.9.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/preflight-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/preflight-app-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/slf4j-api-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/tess4j-3.4.8.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/xmlgraphics-commons-1.5.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/xmpbox-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/LIB/junit-platform-console-standalone-1.5.1.jar Exec \ No newline at end of file +mkdir bin + +javac -cp ".;jar/*" -d bin src/*/*.java src/Exec.java + +java -Dfile.encoding=UTF-8 -classpath ./bin;./jar/commons-beanutils-1.9.2.jar;./jar/commons-io-2.6.jar;./jar/commons-logging-1.2-javadoc.jar;./jar/commons-logging-1.2.jar;./jar/fontbox-2.0.16.jar;./jar/fontbox-2.0.9.jar;./jar/ghost4j-1.0.1.jar;./jar/hamcrest-core-1.3.jar;./jar/itext-2.1.7.jar;./jar/jai-imageio-core-1.4.0.jar;./jar/jbig2-imageio-3.0.0.jar;./jar/jboss-vfs-3.2.12.Final.jar;./jar/jcl-over-slf4j-1.7.25.jar;./jar/jna-4.1.0.jar;./jar/jul-to-slf4j-1.7.25.jar;./jar/junit-4.12.jar;./jar/lept4j-1.6.4.jar;./jar/log4j-api-2.12.1.jar;./jar/log4j-core-2.12.1.jar;./jar/log4j-over-slf4j-1.7.25.jar;./jar/logback-classic-1.2.3.jar;./jar/logback-core-1.2.3.jar;./jar/pdfbox-2.0.16.jar;./jar/pdfbox-2.0.9.jar;./jar/pdfbox-app-2.0.16.jar;./jar/pdfbox-debugger-2.0.16.jar;./jar/pdfbox-tools-2.0.16.jar;./jar/pdfbox-tools-2.0.9.jar;./jar/preflight-2.0.16.jar;./jar/preflight-app-2.0.16.jar;./jar/slf4j-api-1.7.25.jar;./jar/tess4j-3.4.8.jar;./jar/xmlgraphics-commons-1.5.jar;./jar/xmpbox-2.0.16.jar;/LIB/junit-platform-console-standalone-1.5.1.jar Exec \ No newline at end of file diff --git a/launcher.sh b/launcher.sh index be92b01..3c0d771 100644 --- a/launcher.sh +++ b/launcher.sh @@ -1,5 +1,7 @@ #!bin/bash -#javac -cp ".:jar/*" -d bin src/*/*.java src/Exec.java; +mkdir bin -java -Dfile.encoding=UTF-8 -classpath /Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/bin:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-beanutils-1.9.2.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-io-2.6.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-logging-1.2-javadoc.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/commons-logging-1.2.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/fontbox-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/fontbox-2.0.9.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/ghost4j-1.0.1.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/hamcrest-core-1.3.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/itext-2.1.7.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jai-imageio-core-1.4.0.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jbig2-imageio-3.0.0.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jboss-vfs-3.2.12.Final.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jcl-over-slf4j-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jna-4.1.0.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/jul-to-slf4j-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/junit-4.12.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/lept4j-1.6.4.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/log4j-api-2.12.1.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/log4j-core-2.12.1.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/log4j-over-slf4j-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/logback-classic-1.2.3.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/logback-core-1.2.3.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-2.0.9.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-app-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-debugger-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-tools-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/pdfbox-tools-2.0.9.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/preflight-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/preflight-app-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/slf4j-api-1.7.25.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/tess4j-3.4.8.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/xmlgraphics-commons-1.5.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/jar/xmpbox-2.0.16.jar:/Users/louis/Desktop/IUT_S3/PT/pt-s3t-g4/LIB/junit-platform-console-standalone-1.5.1.jar Exec \ No newline at end of file +javac -cp ".:jar/*" -d bin src/*/*.java src/Exec.java; + +java -Dfile.encoding=UTF-8 -classpath ./bin:./jar/commons-beanutils-1.9.2.jar:./jar/commons-io-2.6.jar:./jar/commons-logging-1.2-javadoc.jar:./jar/commons-logging-1.2.jar:./jar/fontbox-2.0.16.jar:./jar/fontbox-2.0.9.jar:./jar/ghost4j-1.0.1.jar:./jar/hamcrest-core-1.3.jar:./jar/itext-2.1.7.jar:./jar/jai-imageio-core-1.4.0.jar:./jar/jbig2-imageio-3.0.0.jar:./jar/jboss-vfs-3.2.12.Final.jar:./jar/jcl-over-slf4j-1.7.25.jar:./jar/jna-4.1.0.jar:./jar/jul-to-slf4j-1.7.25.jar:./jar/junit-4.12.jar:./jar/lept4j-1.6.4.jar:./jar/log4j-api-2.12.1.jar:./jar/log4j-core-2.12.1.jar:./jar/log4j-over-slf4j-1.7.25.jar:./jar/logback-classic-1.2.3.jar:./jar/logback-core-1.2.3.jar:./jar/pdfbox-2.0.16.jar:./jar/pdfbox-2.0.9.jar:./jar/pdfbox-app-2.0.16.jar:./jar/pdfbox-debugger-2.0.16.jar:./jar/pdfbox-tools-2.0.16.jar:./jar/pdfbox-tools-2.0.9.jar:./jar/preflight-2.0.16.jar:./jar/preflight-app-2.0.16.jar:./jar/slf4j-api-1.7.25.jar:./jar/tess4j-3.4.8.jar:./jar/xmlgraphics-commons-1.5.jar:./jar/xmpbox-2.0.16.jar:/LIB/junit-platform-console-standalone-1.5.1.jar Exec \ No newline at end of file diff --git a/src/ocr/PdfToImage.java b/src/ocr/PdfToImage.java index f95acea..ad08b33 100644 --- a/src/ocr/PdfToImage.java +++ b/src/ocr/PdfToImage.java @@ -1,5 +1,6 @@ package ocr; import java.awt.image.BufferedImage; +import java.util.logging.Logger; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -20,6 +21,8 @@ import org.apache.pdfbox.rendering.PDFRenderer; import lecturePdf.Recadrage; public class PdfToImage { + + //Logger.getLogger("org.apache.pdfbox").setLevel(java.util.logging.Level.OFF); public List listAllFiles(String directory, String extension) { // https://www.mkyong.com/java/java-how-to-list-all-files-in-a-directory/