Skip to content
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 REQUEST] Workflow for automatic OCR, PDF Export, sync and delete #356

Open
supaeasy opened this issue Nov 30, 2024 · 13 comments
Open
Labels
enhancement New feature or request

Comments

@supaeasy
Copy link

Is your feature request related to a problem? Please describe.
No, it is a feature request to use it as the scanner and OCR App for paperless-ngx and alike

Describe the solution you'd like
I would love to be able to define a fixed workflow/profile to start automatically after a picture has been taken:

  • improve Image (possible already)
  • white paper (possible already)
  • perform OCR
  • Export PDF
  • Sync PDF to WebDAV folder (better: send it there directly)
  • delete local scan after 5 minutes (or immediately after confirmation sync to WebDAV has been successfull)

Describe alternatives you've considered
Right now I have to do all steps after white paper manually. I use this app to send a PDF to my consume folder of Paperless-ngx

Additional context
If this whole this is too complicated please at least two things: I dont really get the point of "syncing" with WebDAV-Folder. The file is not deleted after it is synced and when I sync it again, I get a duplicate in my consume folder. And: Auto-OCR. I keep forgetting it and Paperless OCR is crap.

@supaeasy supaeasy added the enhancement New feature or request label Nov 30, 2024
@farfromrefug
Copy link
Collaborator

@supaeasy the WebDAV sync (PDF /images) can be used for people not using paperless. Or people.using paperless where a folder on the WebDAV server would be read by paperless.

So in your request only the auto OCR / delete is not possible right now. PDF auto generate sync already exist.

About the delete not sure I want to.add this. Too dangerous people would.complain they document werr deleted . what you could easily do for now is add those doc in a folder. And regularly simply select that folder and do delete (one op).
As for the auto OCR I will look at it. But remember this won't be fast.
Maybe I could add it as an option of the PDF sync that way it would be done in thé background. Would that be good for you?

@supaeasy
Copy link
Author

supaeasy commented Dec 2, 2024

Thanks for your reply. Yes, this is kind of what I want to do. But would this also auto export the PDF? I would need:

  • Trigger: Picture taken and Image enhancements applied
  • Automation: OCR, Export PDF, Sync PDF
  • Ideally: some confirmation / event / message when Sync is complete that I can use as a trigger for macro droid so it can empty the export folder.

@farfromrefug
Copy link
Collaborator

Thanks for your reply. Yes, this is kind of what I want to do. But would this also auto export the PDF? I would need:

* Trigger: Picture taken and Image enhancements applied

* Automation: OCR, Export PDF, Sync PDF

* Ideally: some confirmation / event / message when Sync is complete that I can use as a trigger for macro droid so it can empty the export folder.

Yes if you setup PDF sync (either webdav or local folder) it should trigger as soon as you create a new (or update) doc

As for the confirmation, right now the UX is redrawn on sync success but now confirmation/event/message. I could add a broadcast if you want to notify of sync change

@supaeasy
Copy link
Author

supaeasy commented Dec 3, 2024

That would be great, thank you.
On another note: It was totally unclear to me, that a PDF is created automatically, wether you press export or not - what is the export button for then?

@farfromrefug
Copy link
Collaborator

@supaeasy it is released https://github.com/Akylas/OSS-DocumentScanner/releases/tag/com.akylas.documentscanner%2Fandroid%2Fgithub%2F1.13.0%2F106.

Now about your export question. No a PDF is created automatically when you "show" the pdf menu. It is created only when using each of the commands (share, export,...) The difference is that with export it is created where you want, while for other options it is created in a temp folder so that it gets removed

@supaeasy
Copy link
Author

supaeasy commented Dec 9, 2024

Thank you very much, that was way quicker than I expected! But may I ask where that option is to be found? Or is Auto-OCR now just the default?

@farfromrefug
Copy link
Collaborator

@supaeasy you can enable it within your sync configuration settings. Go into sync settings -> PDF sync. Click on your sync config. Their you can enable it

@supaeasy
Copy link
Author

supaeasy commented Dec 9, 2024

Great, I found it. Thank you! Did you also implement the "broadcast" you mentioned when a sync event ended successfully? (Actually I don't know what that means but I assume this is some kind of event that I can pick up with MacroDroid for a deletion trigger as discussed, yes?)
My favored way still would be a built-in delete option after sync, I think that would be cleaner. That option would Ideally fit into the same place as the new OCR option because one could define it on a sync event base - wouldn't that leave your worries behind? You said people would likely complain about deleted documents - I think an opt-in option that far into the sync settings would assure this is only used by people like me who really want this to happen.

Maybe to elaborate why I am kind of pushy about this: I sync directly to a so called "consume" folder for Paperless. This is a constantly monitored watchfolder and every document in there will be deleted after it has been processed by Paperless. So your App will see an empty folder after a couple of seconds and will re-sync all documents. This process creates neverending duplicates after duplicates and is especially annoying when using auto-sync. Do you understand why this is a major pain point to me? :-)

@farfromrefug
Copy link
Collaborator

@supaeasy what actually do you want to delete? Do you want to delete the document from OSS Document scanner app? Or is it deleting files in the local folder?

@supaeasy
Copy link
Author

Well, both actually. I just want to transfer a scan to my WebDAV folder and delete it from my cellphone afterwards.

@farfromrefug
Copy link
Collaborator

@supaeasy ok :

  • delete doc in the app: possible though tricky because there could be multiple sync running and if i delete the doc too soon it will break the app
  • delete the file create in the local folder. That i cant, has to be done by paperless (i dont know when it finished processing it)

@supaeasy
Copy link
Author

Oh, I misunderstood you: as in 'local folder' on the phone. Deletion from my synced folder is done automatically by paperless. To me that would be the remote folder.

Deletion in App: does the app not get a feedback when syncing is done?

@farfromrefug
Copy link
Collaborator

Oh, I misunderstood you: as in 'local folder' on the phone. Deletion from my synced folder is done automatically by paperless. To me that would be the remote folder.

Deletion in App: does the app not get a feedback when syncing is done?

Yes it does but syncing happens in a background thread in a parallel way. So the sync for which you want deletion might have finished while others are still running. And i would need to handle the deletion on a per sync basis. It is tricky. Not saying it is not feasible, just saying have to be done right and for now not easily done.
As i mentioned before i think the cleanest and easiest way right now is to do it in a folder, and then once in a while you delete all documents from that folder from the app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants