我目前正在使用pdf2image(一种poppler包装器)将pdf转换为枕头图像,以便查看pdf。但是,无论我使用什么pdf,我总是会遇到以下错误:
Traceback (most recent call last):
File "C:\Users\karee\AppData\Local\Programs\Python\Python39-32\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "C:\Users\karee\AppData\Local\Programs\Python\Python39-32\lib\threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\karee\AppData\Local\Programs\Python\Python39-32\lib\subprocess.py", line 1479, in _readerthread
buffer.append(fh.read())
MemoryError
有没有办法解决这个问题,改变我的电脑规格或得到一个新的? 这是我的密码:
root = Tk()
pdf_frame = Frame(root).pack(fill=BOTH, expand=1)
scrol_y = Scrollbar(pdf_frame, orient=VERTICAL)
pdf = Text(pdf_frame, yscrollcommand=scrol_y.set, bg="grey")
scrol_y.pack(side=RIGHT, fill=Y)
scrol_y.config(command=pdf.yview)
pdf.pack(fill=BOTH, expand=1)
pages = convert_from_path('Books/Keeper Of The Lost Cities/Everblaze ( PDFDrive ).pdf', size=(800, 900),
poppler_path=r"poppler-21.03.0\Library\bin")
photos = []
for i in range(len(pages)):
photos.append(ImageTk.PhotoImage(pages[i]))
for photo in photos:
pdf.image_create(END, image=photo)
pdf.insert(END, '\n\n')
mainloop()
任何帮助都将不胜感激
只需批量转换PDF文件,每次5个。i、 e
相关问题 更多 >
编程相关推荐