0

I have a PDF image for transfer to image format so I am trying to read the PDF image and store the data in the text file.

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)

When I run this I get the error can't set attribute

Iain Duncan
  • 3,139
  • 2
  • 17
  • 28

0 Answers0