From c75ec4550fe61fd09f7fdb520b7dbeba1ca47615 Mon Sep 17 00:00:00 2001 From: Louis Calas Date: Thu, 26 Sep 2019 22:17:16 +0200 Subject: [PATCH] Update progressbar --- NGCC/src/ocr_orm/Main.java | 46 --------------------------- NGCC/src/progressbar/ProgressBar.java | 2 ++ 2 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 NGCC/src/ocr_orm/Main.java diff --git a/NGCC/src/ocr_orm/Main.java b/NGCC/src/ocr_orm/Main.java deleted file mode 100644 index d6484c0..0000000 --- a/NGCC/src/ocr_orm/Main.java +++ /dev/null @@ -1,46 +0,0 @@ -package ocr_orm; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - - -import org.apache.pdfbox.pdmodel.PDDocument; - -public class Main { - - public static void main(String args[]) throws IOException { - - PdfToImage pdfAnalyzer = new PdfToImage(); - File pdfFile; - PDDocument document = null; - //LISTE DES IMAGES - ArrayList images = new ArrayList<>(); // stockera les images (resultat) - //HASHMAP POUR LE CSV - HashMap listeNumNote = new HashMap(); - - // CONVERT PAGES TO IMAGES - try { - String pdfFilesDirectory = "C:\\Users\\ph807242\\eclipse-workspace\\PT\\pdf\\"; - // nom du fichier pdf à ouvrir (TODO: changer le chemin) - List files = pdfAnalyzer.listAllFiles(pdfFilesDirectory, ".pdf"); - for (String fname : files) { - pdfFile = new File(fname); - document = PDDocument.load(pdfFile); // charge le fichier pdf cree pour le traiter - images.addAll(pdfAnalyzer.convertPagesToBWJPG(document)); - // appelle la methode qui convertit les pages en images (jpg) noir et blanches - } - } catch (IOException e) { - System.out.println(e); - } - - //LISTE DES IMAGES COMPRENANT L'IMAGE DE LA NOTE ET DU NUM ETUDIANT - ListeImageNGCC liNGCC = new ListeImageNGCC(images); - - listeNumNote = liNGCC.doOCR(); - - - } -} diff --git a/NGCC/src/progressbar/ProgressBar.java b/NGCC/src/progressbar/ProgressBar.java index c520075..e6ba274 100644 --- a/NGCC/src/progressbar/ProgressBar.java +++ b/NGCC/src/progressbar/ProgressBar.java @@ -1,5 +1,7 @@ package progressbar; +// Source : https://masterex.github.io/archive/2011/10/23/java-cli-progress-bar.html + public class ProgressBar { private StringBuilder progress;