I haven't used this, so I can't say it's good or not, but from a quick look at the GitHub it seems to do what you want but it's not actively maintained it seems
Discussion
had just found this one in @zapstore
https://github.com/littletrickster/pdf-doc-scan
does the trick nicely