📅  最后修改于: 2022-03-11 14:47:09.503000             🧑  作者: Mango
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