title: Extracting text from scanned pdf (images) using Python PyPDF2
body: <p>I have been trying to extract text from a scanned PDF (images with non selectable text).</p>
  
  <p>But, I am getting an out put which is not a human readable.</p>
  
  <p>I want the information which contains DATE, INVOICE NO from pdf link(<a href="https://drive.google.com/file/d/1qQsqhlSKTZs-hlswrV8PIirR36896KXZ/view" rel="nofollow noreferrer">https://drive.google.com/file/d/1qQsqhlSKTZs-hlswrV8PIirR36896KXZ/view</a>).</p>
  
  <p>Please help me in extracting and storing the same in plain text.</p>
  
  <pre><code>import PyPDF2
  from PIL import Image
  pdf_reader = PyPDF2.PdfFileReader(r'document.pdf', 'rb')
  page = pdf_reader.getPage(85)
  if '/XObject' in page['/Resources']:
      xobject = page['/Resources']['/XObject'].getObject()
      for obj in xobject:
          if xobject[obj]['/Subtype'] == '/Image':
              size = (xobject[obj]['/Width'], xobject[obj]['/Height'])
              data = xobject[obj]._data
              print("*******", data)
              print(xobject[obj]['/Filter'])
  </code></pre>