OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

PDF data extraction with PyPDF2

  • Thread starter Thread starter Ray Diamond
  • Start date Start date
R

Ray Diamond

Guest
Now I'm trying to extract data from PDF. but I'm getting Deprecation Error.

Code:
`import PyPDF2

pdf_file = open('cr95.pdf', 'rb')

pdf_reader = PyPDF2.PdfFileReader(pdf_file)

text = ''
for page_num in range(pdf_reader.numPages):
    page = pdf_reader.getPage(page_num)
    text += page.extractText()

pdf_file.close()

print(text)

I'm going to get a list of MBA from PDF.

I'm going to get a list of names from pdf.
<p>Now I'm trying to extract data from PDF.
but I'm getting Deprecation Error.</p>
<pre><code>`import PyPDF2

pdf_file = open('cr95.pdf', 'rb')

pdf_reader = PyPDF2.PdfFileReader(pdf_file)

text = ''
for page_num in range(pdf_reader.numPages):
page = pdf_reader.getPage(page_num)
text += page.extractText()

pdf_file.close()

print(text)
</code></pre>
<p>I'm going to get a list of MBA from PDF.</p>
<p>I'm going to get a list of names from pdf.</p>
 
Top