我已经尝试使用 pyPdf 和 pdfMiner 从 pdf 文件中提取文本。我有一些不友好的 pdf,只有 pdfMiner 能够成功提取。我正在使用代码 here提取整个文件的文本。但是,我真的很想在每页的基础上提取文本,例如 pyPdf 中的 getPage(i).extractText()
功能。有谁知道如何使用 pdfMiner 提取每页的文本?
最佳答案
for pageNumber, page in enumerate(PDFDocument.get_pages()):
if pageNumber == 42:
#do something with the page
有篇不错的文章here .
关于python - 使用 Python pdfMiner 每页提取文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12605170/