From 9498601a376990ed8313a02a16d5fa24805df20f Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 10 Oct 2017 12:13:20 -0700 Subject: [PATCH] Add docs on adding to docker iamge --- docs/languages.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/languages.rst b/docs/languages.rst index 11582e97..5587fb35 100644 --- a/docs/languages.rst +++ b/docs/languages.rst @@ -33,6 +33,34 @@ Docker users Users of the Docker image may use the alternative :ref:`"polyglot" container ` which includes all languages. +Adding individual language packs to a Docker image +"""""""""""""""""""""""""""""""""""""""""""""""""" + +If you wish to add a single language pack, you could do the following: + +* Download the desired ``.trainedata`` file from the `tessdata `_ repository. Let's use Hebrew in this example (``heb.traineddata``) + +* Copy the file to ``/home/user/downloads/heb.traineddata``. + +* Create a new container based on the ocrmypdf-tess4 image and jump into it with a terminal: + +.. code-block:: bash + + host$ docker run -v /home/user/downloads:/home/docker -it --entrypoint /bin/bash ocrmypdf-tess4 + +* Put the file where Tesseract expects it: + +.. code-block:: bash + + docker$ cp /home/docker/heb.traineddata /usr/share/tesseract-ocr/tessdata + +* Note the container id, and save it as a new image (in this example, ``ocrmypdf-tess4-heb``) + +.. code-block:: bash + + host$ docker commit ocrmypdf-tess4-heb + + Known limitations -----------------