From 35addb8a33485986766e80b1580a023a4bfbdbd8 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 3 Aug 2016 01:29:12 -0700 Subject: [PATCH] Complain if Chinese is requested with settings known to not work Should extend test for other Asian languages --- ocrmypdf/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ocrmypdf/main.py b/ocrmypdf/main.py index 316f1c4f..f962e9db 100755 --- a/ocrmypdf/main.py +++ b/ocrmypdf/main.py @@ -282,6 +282,13 @@ if options.clean and not options.clean_final \ "Tesseract PDF renderer cannot render --clean pages without " "also performing --clean-final, so --clean-final is assumed.") +if set(options.language) & {'chi_sim', 'chi_tra'} \ + and (options.pdf_renderer == 'hocr' or options.output_type == 'pdfa'): + complain( + "Your settings are known to cause problems with OCR of Chinese text. " + "Try adding these arguments: " + " ocrmypdf --pdf-renderer tesseract --output-type pdf") + lossless_reconstruction = False if options.pdf_renderer == 'hocr': if not options.deskew and not options.clean_final and not options.force_ocr: