As always, Ghostscript is the way.
$ gs sDEVICE=txtwrite -o output.txt input.pdf
$ gs sDEVICE=txtwrite -o output.txt input.pdf
Haven't done it in a while, but looks like this should work: https://askubuntu.com/a/845119
Obviously replace convert with mogrify ./* after backing them up
$ ocrmypdf --sidecar text.txt input.pdf output.pdf