esc2pdf is a MIT licensed pure Python library to interprete old 9-pin ESC/P printer codes and convert those directly to PDF. Unlike other solutions out there, the generated PDf will contain real text rather than dot-matrix images.
Please check out my github repository for a full description.
https://github.com/szihlmann/esc2pdf