Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
Add an example for pdf2pdfocr with the pre-consume hook
Browse files Browse the repository at this point in the history
  • Loading branch information
danielquinn committed Sep 22, 2018
1 parent cce6b43 commit b4b4d8f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/consumption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,29 @@ Pre-consumption script

* Document file name

A simple but common example for this would be creating a simple script like
this:

.. code:: bash
:name: "/usr/local/bin/ocr-pdf"
#!/usr/bin/env bash
pdf2pdfocr.py -i ${1}
.. code:: bash
:name: /etc/paperless.conf
...
PAPERLESS_PRE_CONSUME_SCRIPT="/usr/local/bin/ocr-pdf"
...
This will pass the path to the document about to be consumed to ``/usr/local/bin/ocr-pdf``,
which will in turn call `pdf2pdfocr.py`_ on your document, which will then
overwrite the file with an OCR'd version of the file and exit. At which point,
the consumption process will begin with the newly modified file.

.. _pdf2pdfocr.py: https://github.com/LeoFCardoso/pdf2pdfocr


.. _consumption-director-hook-variables-post:

Expand Down

0 comments on commit b4b4d8f

Please sign in to comment.