-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: progress callback for ocrmypdf (background usage) #1451
Comments
Here an example of how it would be integrated in an API server for instance :
|
This functionality already exists. You can replace the standard progress bar with something that notifies another progress monitor. Over here, give or take: https://github.com/ocrmypdf/OCRmyPDF/blob/main/src/ocrmypdf/pluginspec.py#L143 |
So yes, I think it would be better to use the existing hook for this. Something seems to be wrong with the documentation build - if you look at the source files for the documentation there is a more detailed explanation. |
For anybody interested in how to use the progress bar in a frontend, here I demonstrate how to use the plugin and store and send the progress bar to an html page using REST endpoints |
Describe the proposed feature
Description
Hi! I’d like to request a feature that provides a progress callback mechanism. Specifically, I’m interested in being able to run
ocrmypdf.ocr()
in the background (e.g. via FastAPI in a separate thread) and receive real-time updates on its progress.I noticed there was some discussion in issue #511, mentioning a plugin approach and a link to plugins docs, but that link seems to be broken now.
Proposal
progress_callback
, toocrmypdf.ocr(...)
.This would facilitate showing progress in real time without parsing logs or CLI output.
If you think that could be useful, I'm open to work on it. Alternatively, if you think implementing it via the plugin system is better suited, I’m open to working on that too
Why this is useful
I’m happy to contribute a pull request if this aligns with the project’s vision. Let me know what you think, and thank you for creating such a useful tool!
The text was updated successfully, but these errors were encountered: