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