title: How do I use pdfminer.pdffont to extract font size and name as library
body: <p><strong>I wish to extract the font of every word and its size in pdfminer</strong>
  this is code to extract the layout of pdf using pdfminer 
  so to extract pdffont what should I do
  don't tell me use the command line i wish to use that in my code</p>
  
  <pre><code>def read_pdf_miner(fileObj):
      """
      This function takes the file object, read the file content and store it into a dictionary for processing
  
      :param fileObj: File object for reading the file
      :return: None
      """
      file_pointer = open(fileObj,'rb')
  
      parser = PDFParser(file_pointer)
  
      document = PDFDocument(parser)
  
      if not document.is_extractable:
          raise PDFTextExtractionNotAllowed
  
  
      rsrcmgr = PDFResourceManager()
  
      device = PDFDevice(rsrcmgr)
  
      laparams = LAParams()
  
      device = PDFPageAggregator(rsrcmgr, laparams=laparams)
  
      interpreter = PDFPageInterpreter(rsrcmgr, device)
      page_num = 1
      id = 0
      for page in PDFPage.create_pages(document):
          interpreter.process_page(page)
  
          layout = device.get_result()
          for lt_obj in layout:
              if isinstance(lt_obj, LTTextBoxHorizontal):
                  text_dict[id] = lt_obj.get_text()
                  text_prop_dict[id] = lt_obj
                  id += 1
          page_dict[page_num]=text_prop_dict.copy()
          text_prop_dict.clear()
          page_num += 1
  </code></pre>