Suppress --pdf-renderer tesseract warning in Docker image

Since the corrected font is provided in the Docker image, there's no
reason to show the warning.
This commit is contained in:
James R. Barlow
2016-02-17 01:03:20 -08:00
parent 71d616e413
commit d4ef3411e0
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -74,6 +74,7 @@ WORKDIR /home/docker
ENV OCRMYPDF_TEST_OUTPUT=/tmp/test-output
ENV OCRMYPDF_IN_DOCKER=1
ENV OCRMYPDF_SHARP_TTF=1
# Must use array form of ENTRYPOINT
# Non-array form does not append other arguments, because that is "intuitive"
+3 -2
View File
@@ -227,10 +227,11 @@ if not set(options.language).issubset(tesseract.languages()):
if options.pdf_renderer == 'auto':
options.pdf_renderer = 'hocr'
if options.pdf_renderer == 'tesseract' and tesseract.version() < '3.04.01':
if options.pdf_renderer == 'tesseract' and tesseract.version() < '3.04.01' \
and os.environ.get('OCRMYPDF_SHARP_TTF', '') != '1':
complain(
"WARNING: Your version of tesseract has problems with PDF output. "
"Some PDF viewers will fail to find searchable text. "
"Some PDF viewers will fail to find searchable text.\n"
"--pdf-renderer=tesseract is not recommended.")
if any((options.deskew, options.clean, options.clean_final)):