This crate extracts poppler's pdftotext -layout code into a library, linking dynamically to system's poppler.
pdftotext -layout
It was tested with poppler 20.12.1. It calls popper's internal APIs so it may break with future library versions.