docs: def extract_pdf(file_name):
      """
      Extract text from a pdf file
      :param file_name path to pdf to read
      :return text from pdf
      """
  
      rsrcmgr = pdfminer.pdfinterp.PDFResourceManager()
      sio = StringIO()
      laparams = LAParams()
      device = TextConverter(rsrcmgr, sio, codec='utf-8', laparams=laparams)
      interpreter = pdfminer.pdfinterp.PDFPageInterpreter(rsrcmgr, device)
  
      # Extract text from pdf file
      with open(file_name, 'rb') as fp:
          for page in PDFPage.get_pages(fp, maxpages=20):
              interpreter.process_page(page)
  
      text = sio.getvalue()
  
      # Cleanup
      device.close()
      sio.close()
  
      return text