I'm attempting to extract the text from a pdf file using python
With the help of PyPDF2 module, I tried this following code:
pdf_file = open('sample.pdf')
read_pdf = PyPDF2.PdfFileReader(pdf_file)
number_of_pages = read_pdf.getNumPages()
page = read_pdf.getPage(0)
page_content = page.extractText()
But, When I execute the code, I'm getting this kind of output, which is actually different from the PDF document, which I included.
How to extract the text from the PDF document?