How to extract text from pdf in Python 3.7

后端 未结 10 1184
后悔当初
后悔当初 2020-12-29 10:19

I am trying to extract text from a PDF file using Python. My main goal is I am trying to create a program that reads a bank statement and extracts its text to update an exce

10条回答
  •  时光说笑
    2020-12-29 11:13

    PyPDF2 does not read whole pdf correctly. You must use this code.

        import pdftotext
    
        pdfFileObj = open("January2019.pdf", 'rb')
    
    
        pdf = pdftotext.PDF(pdfFileObj)
    
        # Iterate over all the pages
        for page in pdf:
            print(page)
    

提交回复
热议问题