From f57dda79398ef1246424e19f82654998ba8ec87f Mon Sep 17 00:00:00 2001 From: jumblies Date: Fri, 8 Mar 2019 15:46:50 -0500 Subject: [PATCH] Update batch.rst (#362) Added docker instructions for passing "find" filenames into container. Obviates prior incorrect flag fix. --- docs/batch.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/batch.rst b/docs/batch.rst index d905752f..c63682f3 100644 --- a/docs/batch.rst +++ b/docs/batch.rst @@ -27,7 +27,13 @@ This will walk through a directory tree and run OCR on all files in place, print .. code-block:: bash - find . --printf '%p' -name '*.pdf' -exec ocrmypdf '{}' '{}' \; + find . -printf '%p' -name '*.pdf' -exec ocrmypdf '{}' '{}' \; + +Alternatively, with a docker container (mounts a volume to the container where the PDFs are stored): + +.. code-block:: bash + + find . -printf '%p' -name '*.pdf' -exec docker run --rm -v : jbarlow83/ocrmypdf-alpine '/{}' '/{}' \; This only runs one ``ocrmypdf`` process at a time. This variation uses ``find`` to create a directory list and ``parallel`` to parallelize runs of ``ocrmypdf``, again updating files in place.