title: How to convert PDF document to JSON Using Python script
body: <p>Trying to convert an PDF form to JSON data using python</p>
  
  <p><strong>Sample PDF Format :</strong> </p>
  
  <p><a href="https://i.stack.imgur.com/aOHzu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aOHzu.png" alt="enter image description here"></a></p>
  
  <p><strong>Code :</strong></p>
  
  <pre><code>import PyPDF2
  pdf_file = open('C:\\Users\\Desktop\\data.pdf', 'rb')
  read_pdf = PyPDF2.PdfFileReader(pdf_file)
  number_of_pages = read_pdf.getNumPages()
  page = read_pdf.getPage(0)
  page_content = page.extractText()
  import json
  data = json.dumps(page_content)
  formatj = json.loads(data)
  </code></pre>
  
  <p>But I am not getting the output the proper JSON Format</p>