From c93c996edf32b959d74806dbf097de0917155fd3 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:43:05 -0700 Subject: [PATCH] Remote ocr reprocess (#13636) * Backend stuff for remote ocr reprocess, add to bulk edit pass in from ui settings * Ok, frontend reprocess remote option * Docs --- docs/api.md | 3 +- docs/usage.md | 2 + .../reprocess-confirm-dialog.component.html | 28 ++++++++ ...reprocess-confirm-dialog.component.spec.ts | 72 +++++++++++++++++++ .../reprocess-confirm-dialog.component.ts | 20 ++++++ .../document-detail.component.spec.ts | 14 +++- .../document-detail.component.ts | 8 ++- .../bulk-editor/bulk-editor.component.spec.ts | 1 + .../bulk-editor/bulk-editor.component.ts | 8 ++- src-ui/src/app/data/ui-settings.ts | 13 ++++ .../services/rest/document.service.spec.ts | 15 ++++ .../src/app/services/rest/document.service.ts | 6 +- .../src/app/services/settings.service.spec.ts | 23 ++++++ src-ui/src/app/services/settings.service.ts | 12 ++++ src/documents/bulk_edit.py | 10 ++- src/documents/serialisers.py | 11 ++- src/documents/tests/test_api_bulk_edit.py | 47 +++++++++++- src/documents/tests/test_api_uisettings.py | 48 +++++++++++++ src/documents/tests/test_bulk_edit.py | 53 ++++++++++++++ src/documents/views.py | 7 ++ 20 files changed, 390 insertions(+), 11 deletions(-) create mode 100644 src-ui/src/app/components/common/confirm-dialog/reprocess-confirm-dialog/reprocess-confirm-dialog.component.html create mode 100644 src-ui/src/app/components/common/confirm-dialog/reprocess-confirm-dialog/reprocess-confirm-dialog.component.spec.ts create mode 100644 src-ui/src/app/components/common/confirm-dialog/reprocess-confirm-dialog/reprocess-confirm-dialog.component.ts diff --git a/docs/api.md b/docs/api.md index 58927229d..91e8492ed 100644 --- a/docs/api.md +++ b/docs/api.md @@ -302,7 +302,8 @@ The following methods are supported: - `delete` - No `parameters` required - `reprocess` - - No `parameters` required + - Optional `parameters`: `{ "remote_ocr": true }` to send the documents to the + remote OCR engine, see [Remote OCR](usage.md#remote-ocr). Defaults to false. - `set_permissions` - Requires `parameters`: - `"set_permissions": PERMISSIONS_OBJ` (see format [above](#permissions)) and / or diff --git a/docs/usage.md b/docs/usage.md index 42e2716ba..0dc13b07a 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -1100,6 +1100,8 @@ By default, every document of a supported file type is sent to the remote engine [remote OCR mode](configuration.md#PAPERLESS_REMOTE_OCR_MODE) to `workflow_only`. Documents are then processed locally unless a workflow explicitly enables remote OCR for them, so you can limit the remote engine to particular documents. +Setting the mode to `workflow_only` also allows the **Reprocess** actions to selectively use remote OCR for individual documents. + ## Architecture Paperless-ngx consists of the following components: diff --git a/src-ui/src/app/components/common/confirm-dialog/reprocess-confirm-dialog/reprocess-confirm-dialog.component.html b/src-ui/src/app/components/common/confirm-dialog/reprocess-confirm-dialog/reprocess-confirm-dialog.component.html new file mode 100644 index 000000000..eccd39c3b --- /dev/null +++ b/src-ui/src/app/components/common/confirm-dialog/reprocess-confirm-dialog/reprocess-confirm-dialog.component.html @@ -0,0 +1,28 @@ +
{{messageBold}}
+ } + @if (message) { + + } + @if (showRemoteOcr) { +