diff --git a/RAAspotter.py b/RAAspotter.py index 5d1798967547ce24ec58f1cc1ec44845b363934f..acf2a99d112ca5fd26de31cf64a591f27be09ee3 100644 --- a/RAAspotter.py +++ b/RAAspotter.py @@ -80,7 +80,10 @@ class RAAspotter: reader = PdfReader(f'{raa_data_dir}{self.get_sha256()}.ocr.pdf') for page in reader.pages: - text = text + "\n" + page.extract_text() + try: + text = text + "\n" + page.extract_text() + except Exception as exc: + logger.warning(f'ATTENTION: Impossible d\'extraire le texte du fichier {self.get_sha256()}.pdf : {exc}') # Écrit le texte du PDF dans un fichier texte pour une analyse future f = open(f'{raa_data_dir}{self.get_sha256()}.txt', 'w')