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.
+The script's stdout and stderr will be logged line by line to the webserver log, along
+with the exit code of the script.
+
.. _pdf2pdfocr.py: https://github.com/LeoFCardoso/pdf2pdfocr
.. _advanced-post_consume_script:
The post consumption script cannot cancel the consumption process.
+The script's stdout and stderr will be logged line by line to the webserver log, along
+with the exit code of the script.
+
+
Docker
------
Assumed you have ``/home/foo/paperless-ngx/scripts/post-consumption-example.sh``.
)
# Decode the output (if any)
- stdout_str = completed_process.stdout.decode("utf8", errors="ignore").split(
- "\n",
+ stdout_str = (
+ completed_process.stdout.decode("utf8", errors="ignore")
+ .strip()
+ .split(
+ "\n",
+ )
)
- stderr_str = completed_process.stderr.decode("utf8", errors="ignore").split(
- "\n",
+ stderr_str = (
+ completed_process.stderr.decode("utf8", errors="ignore")
+ .strip()
+ .split(
+ "\n",
+ )
)
if len(stdout_str):