导入PDF图像以转换为文本时出错

时间:2019-05-10 05:11:50

标签: python-3.x python-imaging-library python-tesseract python-imageio

我有一个要转换为图像格式的PDF图像,因此我试图读取PDF图像并将数据存储在文本文件中。

import pytesseract
from PIL import Image

img = Image.open('1.pdf')
text = pytesseract.image_to_string(img)
with open('1.txt', mode='w') as file:
    file.write(text)

运行此命令时出现错误can't set attribute

0 个答案:

没有答案
相关问题