if isinstance(lt_obj, LTTextBox) or isinstance(lt_obj, LTTextLine):
    print(lt_obj.get_text())
elif isinstance(lt_obj, LTFigure):
    parse_layout(lt_obj)
fp = open('example.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)
Как получить местоположение текста в PDF с помощью PDFMiner?