📜  使用 python-poppler - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:09.503000             🧑  作者: Mango

代码示例1
from poppler import load_from_file, PageRenderer

pdf_document = load_from_file("sample.pdf")
page_1 = pdf_document.create_page(0)
page_1_text = page_1.text()

renderer = PageRenderer()
image = renderer.render_page(page_1)
image_data = image.data