title: Navigate between text box using PDFMiner
body: <p>I refer to the code that has been provided by PDFminer:</p>
  
  <pre><code>from pdfminer.pdfdocument import PDFDocument
  from pdfminer.pdfpage import PDFPage
  from pdfminer.pdfparser import PDFParser
  from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
  from pdfminer.converter import PDFPageAggregator
  from pdfminer.layout import LAParams, LTTextBox, LTTextLine, LTFigure
  
  
  def parse_layout(layout):
      """Function to recursively parse the layout tree."""
      for lt_obj in layout:
          print(lt_obj.__class__.__name__)
          print(lt_obj.bbox)
          if isinstance(lt_obj, LTTextBox):
              print(lt_obj.get_text())
          elif isinstance(lt_obj, LTFigure):
              parse_layout(lt_obj)  # Recursive
  
  
  fp = open(r'C:\Users\lucas\Desktop\XX.pdf', 'rb')
  parser = PDFParser(fp)
  doc = PDFDocument(parser)
  
  rsrcmgr = PDFResourceManager()
  laparams = LAParams()
  device = PDFPageAggregator(rsrcmgr, laparams=laparams)
  interpreter = PDFPageInterpreter(rsrcmgr, device)
  for page in PDFPage.create_pages(doc):
      interpreter.process_page(page)
      layout = device.get_result()
      parse_layout(layout)
  </code></pre>
  
  <p>This code is able to read and print the layout of the documents. For example, </p>
  
  <p>LTTextBoxHorizontal
  (21.36, 452.28479999999996, 96.2544, 461.74559999999997)
  MARKS AND NUMBER</p>
  
  <p>I specifically filter only text boxes to be printed. <strong>I was wondering if there is anyway to print specific text boxes or navigate through the text boxes. For example, I want to print the 3rd box from the top, or 5th box from the current text box.</strong></p>
  
  <p>Would greatly appreciate is anyone could help! :)</p>