Python 3.x 用pikepdf从pdf中提取图像
我有一个单页和图像的pdf。我想使用pikepdf库提取图像 我已经按照说明进行了操作,但显然我的图像被多个图像分割/合成,我不知道,因为当我运行时:Python 3.x 用pikepdf从pdf中提取图像,python-3.x,pikepdf,Python 3.x,Pikepdf,我有一个单页和图像的pdf。我想使用pikepdf库提取图像 我已经按照说明进行了操作,但显然我的图像被多个图像分割/合成,我不知道,因为当我运行时: from pikepdf import open as pike_open from pikepdf import PdfImage pdf = open('some_file.pdf') page = pdf.pages[0] list(page.images.keys()) 我得到: ['/Im11', '/Im12', '/Im13
from pikepdf import open as pike_open
from pikepdf import PdfImage
pdf = open('some_file.pdf')
page = pdf.pages[0]
list(page.images.keys())
我得到:
['/Im11',
'/Im12',
'/Im13',
'/Im14',
'/Im15',
'/Im16',
'/Im17',
'/Im18',
'/Im5',
'/Im7',
'/Im9']
如果我继续:
rawimage = page.images['/Im11']
pdf_image = PdfImage(rawimage)
pdf_image.extract_to('image')
我得到了一个image.jpg文件,它只包含pdf中原始图像的上一部分。如何提取整个图像