有大神知道 pdfminer 中的LTFigure物件內容只怎么取出來的嗎
官網上的說明代碼 還報錯lt_obj.objs 沒有objs物件
def parse_lt_objs (lt_objs, page_number, images_folder, text=[]):
"""Iterate through the list of LT* objects and capture the text or image data contained in each"""
text_content = []
for lt_obj in lt_objs:
if isinstance(lt_obj, LTFigure):
# LTFigure objects are containers for other LT* objects, so recurse through the children
text_content.append(parse_lt_objs(lt_obj.objs, page_number, images_folder, text_content))
return '\n'.join(text_content)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/28065.html
