import pdftotext import sys with open("test.pdf", "rb") as f: pdf = pdftotext.PDF(f,physical=True) for page in pdf: print(page)
pdftotext -layout my_file.pdf
Note also that the .pdf must contain TEXT as such. An IMAGE of text will not work as expected with 'pdftotext'.
Note also that the .pdf must contain TEXT as such. An IMAGE of text will not work as expected with 'pdftotext'.