FFmpeg is way cooler than it sounds.
Smarter document extraction starts here.