Beginner here, not sure what I am doing wrong. Any help is greatly appreciated.
Simple Code:
from pdf2image import convert_from_path
images = convert_from_path('sample.pdf', 500, poppler_path=r'C:Program Filespoppler-24.07.0Librarybin')
for i in range(len(images)):
images[i].save('page' + str(i) + '.jpg', 'JPEG')
Error:
pdf2image.exceptions.PDFPageCountError: Unable to get page count.
I/O Error: Couldn't open file 'sample.pdf': No error.
Originally, the module coundn’t get a page count because I did not have a poppler. After I figured out the poppler, I thought it would work, but it still does not.
New contributor
Keeton Matthews is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2